Take the 2-minute tour ×
Stack Overflow is a question and answer site for professional and enthusiast programmers. It's 100% free, no registration required.

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?

share|improve this question

closed as too broad by George Stocker Jan 28 at 16:13

There are either too many possible answers, or good answers would be too long for this format. Please add details to narrow the answer set or to isolate an issue that can be answered in a few paragraphs.If this question can be reworded to fit the rules in the help center, please edit the question.

    
different languages –  charlietfl Nov 15 '13 at 4:43
2  
Yes ... and one is older and more mature than the other two, but I was thinking of the less obvious differences. –  CorayThan Nov 15 '13 at 6:29
add comment

3 Answers

up vote 53 down vote accepted
+50

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.

share|improve this answer
2  
Any idea when it will be in a usable state? Even some basic functions are missing right now it seems and am so excited to start using Dart :( –  SalmanPK Dec 30 '13 at 19:11
    
@SalmanPK AngularDart is usable. What features are your missing? –  James deBoer Jan 2 at 18:24
    
ngModel and ngForm –  SalmanPK Jan 3 at 1:56
    
Basic support for both are already available. We are still working on a few additional features (e.g. validation). –  James deBoer Jan 3 at 2:02
3  
one obvious difference would be browser compatibility - angular.js states "Safari, Chrome, Firefox, Opera, IE8, IE9 and mobile browsers (Android, Chrome Mobile, iOS Safari)" while there is no such claim for angular.dart (haven't found anything on their website) - dart itself targets ECMAScript 5 (>= IE9), but angular.dart uses Shadow DOM and polymer's polyfill for it - and polymer's only target are "evergreen" browsers, not even mentioning mobile browsers. Does anyone know if this is a correct observation? –  herbert Mar 15 at 19:25
show 1 more comment

So the first difference is pretty obvious: AngularJS is written in JavaScript whereas Angular.dart is written in dart.

While Angular.dart follows the core principles of AngularJS it seems to be a bit of a playground for new features to evolve. I guess the core team takes all the learnings from AngularJS and tries to implement things just slightly better for the Angular.dart version. Currently it seems as if a bunch of things are first implemented in the dart version of Angular before they get backported to AngularJS. For instance they just added a more lightweight version of ng-repeat which eventually should end up in AngularJS.

Also the Angular team recently shared some insights on what's planned for Angular 2.0. I bet most of those things will first land in Angular.dart before they land in AngularJS.

share|improve this answer
1  
This statements from a very high point of view. I'm aware that this question may not be a perfect fit for SO but there is not very much documentation available for Angular.dart. So I hoped for a little more substantial information like - where does the markup differ (this should not much depend on the language syntax (at least of the most common constructs to get the idea). - what markup constructs are available in the one but not in the other. IMHO that both products are related and are developed by two groups that talk with each other is a bit thin. –  Günter Zöchbauer Dec 7 '13 at 21:17
add comment

This article lists several differences: ANGULARDART FOR ANGULARJS DEVELOPERS. INTRODUCTION TO THE BEST ANGULAR YET.

share|improve this answer
add comment

Not the answer you're looking for? Browse other questions tagged or ask your own question.