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

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

问题描述

我对 Angular.js 有所了解,但我现在想自学 Dart 和 Angular.dart.不过,我有点好奇两者之间的区别是什么.Angular.dart 教程明确表示不会将两者进行比较.使用过两者的人有没有对它们的区别有什么看法?

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?

推荐答案

更新 #2(2016 年 8 月) Dart 版本的 Angular 现在由 Github 上的 Dart 团队维护:github 上的 dart/angular2

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

更新:AngularDart 项目已被封存并已被 Angular2 取代.Angular2 是 Angular 的最新版本,适用于 Dart.

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

下面的原始答案比较了 AngularDart 和 AngularJS 1.x.

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

AngularDart 和 AngularJS 都由 Angular 团队维护.我们从 JS 方面汲取了很多知识并将其应用于 Dart.我们还采用了大量代码并将其直接移植到 Dart 世界.

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.

在技术层面,Angular 的核心:

At a technical level, in the core of Angular:

  • 表达语言在两个版本之间是兼容的.AngularDart 解析器最初是从 JS 直接移植而来,但一直在不断发展.一个很大的区别是 Dart 解析器支持多个后端,包括一个 Dart 代码生成器.

  • 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.

DI 系统是不同的.在 Dart 中它是基于类的,而在 Javascript 中它是基于符号的.

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

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

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 已经融入浏览器",被标准 shadow DOM 取代.

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

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

directive controllers have been merged into components

AngularDart 中的指令是用带注释的类声明的.链接/编译函数替换为应用函数

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

在 AngularDart 中,范围通过 Dart 区域自动消化,消除了范围的需要.$apply.

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

AngularDart 有一个属性映射的概念,但还没有回到 AngularJS 中.这意味着指令应该需要更少的作用域.$watches 甚至对作用域的依赖.

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天全站免登陆