Angular.dart

(See www.angularjs.org, the Dart project is on https://github.com/angular/angular.dart)

Angular.js (or Angular for short) is a popular open source JavaScript framework, maintained by Google, for developing single-page applications. Its goal is to make browser-based apps with MVC capabilities in an effort to make both development and testing easier. It accomplishes this by using declarative programming for building UI and wiring software components. It uses a templating system with a number of so called directives (starting with ng-) to specify customizable and reusable HTML tags and expressions that moderate the behavior of certain elements; for example, ng-repeat for instantiating an element for each item from a collection, or ng-model for 2-way data binding:

<input type="text" ng-model="lastName" placeholder="Your name"> 

The $scope service detects changes to the model and modifies HTML expressions in the view via a controller. Likewise, any alterations to the view are reflected in the model. In June 2013, the Angular team was expanded to announce and work on a Dart-optimized port of their framework using the same templates but a separate implementation: large parts of Angular functionality—components such as $compiler and $scope, basic directives such as ngBind and ngRepeat—have already been ported over to Dart, and can be used today. Other critical Angular parts such as Dependency Injection and routes are being ported now. Karma, the Angular test runner, already works with Dart. An important project in development within Google uses the Dart version of Angular. So developers can choose to use Angular either with Dart or with JavaScript. At this moment, Angular is not yet published on pub, but it soon will; for now it has to be used as a local package by adding the dependency:

angular:
path: ../..

and importing the package in code as follows:

import 'package:angular/angular.dart';

Check out the hello angular example at https://github.com/jbdeboer/dart-seed.

..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset
18.222.182.66