html5, angularJS with closure compiler and/or closure library

后端 未结 2 1359
独厮守ぢ
独厮守ぢ 2021-02-07 13:05

I\'m considering html5, angularJS for data binding and also google closure compiler and the closure library for interactive web applications. Do those work nicely together? Unfo

相关标签:
2条回答
  • 2021-02-07 13:35

    Hope this help

    Change code

    function MyCtrl($scope) {/* code */}
    

    To

    var MyCtrl = ['$scope', function($scope) {/* code */}]
    
    0 讨论(0)
  • 2021-02-07 13:43

    Closure Compiler

    You can definitely compile your code (Angular itself is compiled with Closure compiler), although you can only use simple optimizations at this point.

    In general we want Angular to play well together with the compiler.

    Closure library

    There is a bunch of project inside Google, using the library together with Angular.

    They use goog.provide() and goog.require() for dependencies. Also using the utilities like goog.isString() or goog.inherits() is absolutely straightforward.

    Using closure UI components might require some extra work (although, again, there are projects using it).

    0 讨论(0)
提交回复
热议问题