简体   繁体   English

html5,带封闭编译器和/或闭包库的angularJS

[英]html5, angularJS with closure compiler and/or closure library

I'm considering html5, angularJS for data binding and also google closure compiler and the closure library for interactive web applications. 我正在考虑用于数据绑定的html5,angularJS以及用于交互式Web应用程序的谷歌闭包编译器和闭包库。 Do those work nicely together? 那些一起工作得很好吗? Unfortunately there seem to be no detailed reports up to now. 不幸的是,到目前为止似乎没有详细的报告。

I have adobe flex experience, but I'm fairly new to pure js. 我有adobe flex经验,但我对纯粹的js相当新。 So the questions can be considered to be from a beginner's perspective. 所以问题可以从初学者的角度来考虑。 There is no codebase that needs to be ported, everything will be developed from scratch. 没有代码库需要移植,一切都将从头开发。

  1. Is anyone else using this combination successfully? 是否有其他人成功使用此组合?
  2. Are there any firsthand reports? 有没有第一手报道?
  3. Do you recommend the individual technologies in this context, or are there better alternatives to combine? 您是否在此背景下推荐了各种技术,还是有更好的替代方案可以合并?
  4. Are there any good examples, example projects or even tutorials (for the combination - not the individual technologies)? 有没有好的例子,示例项目甚至教程(组合 - 而不是个别技术)?
  5. Any pitfalls a beginner should be aware of? 初学者应该注意哪些陷阱?
  6. Are there any other orthoganal technolgies that I should also use or at least consider? 我还应该使用或至少考虑其他任何正交技术吗?

Some more or less relevant links I already found: 我已经找到一些或多或少的相关链接:

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. 您绝对可以编译代码(Angular本身是使用Closure编译器编译的),尽管此时您只能使用简单的优化。

In general we want Angular to play well together with the compiler. 一般来说,我们希望Angular与编译器一起很好地发挥作用。

Closure library 关闭库

There is a bunch of project inside Google, using the library together with Angular. Google内部有一大堆项目,将这个库与Angular一起使用。

They use goog.provide() and goog.require() for dependencies. 他们使用goog.provide()和goog.require()来获取依赖关系。 Also using the utilities like goog.isString() or goog.inherits() is absolutely straightforward. 使用goog.isString()或goog.inherits()等实用程序也非常简单。

Using closure UI components might require some extra work (although, again, there are projects using it). 使用闭包UI组件可能需要一些额外的工作(尽管有些项目使用它)。

Hope this help 希望这有帮助

Change code 改变代码

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

To

var MyCtrl = ['$scope', function($scope) {/* code */}]

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM