Angular.js和Angular.dart之间的区别? [英] Differences between Angular.js and Angular.dart?

查看:675
本文介绍了Angular.js和Angular.dart之间的区别?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我知道一点Angular.js,但我现在想教自己Dart和Angular.dart。我有点好奇,两者之间的差异,虽然。 Angular.dart教程具体说,它不会比较两者。请问谁使用两个人有分歧是什么看法?


解决方案

更新#2(AUG '16 )角的飞镖版本的镖队在Github上目前维持:镖/ angular2在github



更新:AngularDart项目被禁止,已被Angular2取代。 Angular2是最近的角迭代和飞镖的作品。



下原来的答案比较AngularDart和AngularJS 1.x的。



AngularDart和AngularJS都由Angular团队维护。我们已经从JS方面学到了很多知识,并将其应用于Dart。我们还花了很多代码,直接将它移植到Dart世界。



在技术层面上,Angular的核心:




  • 表达式语言在两个版本之间兼容。 AngularDart解析器作为一个直接端口从JS开始,但是一直在发展。 Dart解析器支持多个后端,包括一个Dart代码生成器。一个很大的区别是


  • DI系统是不同的。在Dart中,它是基于JavaScript的基于符号的类。


  • 编译器在Dart版本中已经完全重写。这意味着指令的行为不同,现在在修改DOM,装饰指令和组件的结构指令之间有区别。


  • ng-transclude


  • 指令控制器已合并到组件


  • AngularDart中的指令使用带注释的类声明。链接/编译函数替换为apply函数


  • 在AngularDart中,范围通过Dart区域自动消化,消除了对范围的需求$ apply。 / p>


  • AngularDart有一个属性映射的概念,但还没有回到AngularJS。这意味着指令应该需要更少的范围,$手表甚至是对范围的依赖。




其他差异,但这是一个很好的列表,让你开始。


I know a bit about Angular.js, but I want to teach myself Dart and Angular.dart now. I'm a bit curious what the differences between the two are, though. The Angular.dart tutorial specifically says it won't compare the two. Does anyone who has used both have a perspective on what the differences are?

解决方案

Update #2 (Aug '16) A Dart version of Angular is now maintained by the Dart team on Github: dart/angular2 on github

Update: The AngularDart project is mothballed and has been superseded by Angular2. Angular2 is the most recent iteration of Angular and works in Dart.

The original answer below compares AngularDart and AngularJS 1.x.

AngularDart and AngularJS are both maintained by the Angular team. We've taken a lot of knowledge from the JS side and applied it to Dart. We have also taken a lot of code and ported it straight to the Dart world.

At a technical level, in the core of Angular:

  • The expression language is compatible between the two versions. The AngularDart parser started as a straight port from JS but has been evolving on its own. A big difference there is that the Dart parser supports multiple backends, including a Dart code generator.

  • The DI system is different. In Dart it is class based where in Javascript it is symbol based.

  • The compiler has been completely rewritten in the Dart version. This means that directives behave differently and now there is a distinction between "structural directives" which modify the DOM, "decorative directives" and components.

  • ng-transclude has "melted into the browser", replaced by the standard shadow DOM.

  • directive controllers have been merged into components

  • directives in AngularDart are declared with an annotated class. link / compile functions are replaced with an apply function

  • In AngularDart, the scope is digested automatically through Dart zones, eliminated the need from scope.$apply.

  • AngularDart has a concept of attribute maps which hasn't made it back to AngularJS yet. This means that directives should need many fewer scope.$watches or even a dependency on the Scope.

There may be other differences, but that is a good list to get you started.

这篇关于Angular.js和Angular.dart之间的区别?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆