This page summarizes changes to this site’s documentation and examples. Many of these changes are due to new releases of AngularDart, AngularDart Components, or the Dart SDK. Others are the result of new recommendations or documentation.

Also see:

Introduction and navigation changes (December 2018)

We’ve changed the introductory text and site navigation to more clearly differentiate between the core Dart web platform and frameworks like AngularDart and Hummingbird that build on it.

AngularDart 5.2 / Dart 2.1 (December 2018)

  • Updated Dart SDK and Angular package versions in pubspec.yaml:
    • sdk: '>=2.1.0 <3.0.0'
    • angular: ^5.2.0
    • angular_components: ^0.11.0
    • angular_forms: ^2.1.1
    • angular_router: ^2.0.0-alpha+21
    • angular_test: ^2.2.0
  • Ran dartfix, which changed one class to a mixin.

AngularDart 5.0 beta / Dart 2.0 beta (July 2018)

  • Updated Dart SDK and Angular package versions in pubspec.yaml:
    • sdk: '>=2.0.0-dev.64.2 <3.0.0'
    • angular: ^5.0.0-beta+2
    • angular_components: ^0.9.0-beta
    • angular_forms: ^2.0.0-beta+2
    • angular_router: ^2.0.0-alpha+17
    • angular_test: ^2.0.0-beta+2
  • Switched to new build system:
    • Added new dev_dependencies:
      • build_runner: ^0.9.0
      • build_test: ^0.10.2
      • build_web_compilers: ^0.4.0
    • Dropped dev_dependencies:
      • browser
      • dart_to_js_script_rewriter
    • Dropped all old pub transformers:
      • angular
      • dart_to_js_script_rewriter
      • test/pub_serve
  • Adjusted web/index.html files because Dartium is no longer supported:
    • Dropped <script defer src="packages/browser/dart.js"></script>
    • Replaced <script defer src="main.dart" type="application/dart"></script> by
      <script defer src="main.dart.js"></script>
    • Note: test version 0.12.30 or later runs chrome tests headless by default. We were already using version 0.12.30 along with the Angular 4 examples.
  • Added error option to analysis_options.yaml:
    • uri_has_not_been_generated: ignore
  • Changed app launching code in web/main.dart files:
    • Replaced import 'package:angular_app/app_component.dart' by
      import 'package:angular_app/app_component.template.dart' as ng;
    • Replaced bootstrap(AppComponent) with runApp(ng.AppComponentNgFactory)
  • Switched to compile-time dependency injection:
    • Switched to using typed FooProvider() expressions.

      Angular 4.x provider Angular 5 provider
      Bare class name C ClassProvider(C)
      Provider(C, useClass: D) ClassProvider(C, useClass: D)
      Provider(C, useValue: v) ValueProvider(C, v)
      Provider(C, useFactory: f, deps: d) FactoryProvider(C, f)
      (Compile-time DI makes explicitly declaring deps unnecessary)
      Provider(C, useExisting: D) ExistingProvider(C, D)

      For examples, see Files changed in the dependency-injection diff.

    • Switched to static configuration of root injectors in web/main.dart files that formerly bootstrapped providers. For example, see web/main.dart under the Files changed tab of the toh-5 diff.

  • Updated all test/*_test.dart files and their Angular entry points:
    • Dropped @Tags(const ['aot'])
    • Added import 'foo_test.template.dart' as ng; in the test file for foo components
    • For every function bar() annotated with @AngularEntrypoint():
      • Dropped @AngularEntrypoint()
      • Replaced new NgTestBed<AppComponent>().addProviders(providers) with
        NgTestBed.forComponent<AppComponent>(ng.FooComponentNgFactory, rootInjector: injector); where injector is an injector factory created by a newly added @GenerateInjector-annotated injector field (as described above).
    • Examples:
      • See test/app_test.dart under the Files changed tab of the quickstart diff
      • See test/dashboard.dart under the Files changed tab of the toh-5 diff)
  • Adjusted to new template syntax:
    • Binding syntax:
    • ngFor microsyntax statements must be separated using semicolon (;).
      Using a space or comma to separate statements is no longer supported.
  • Switched to use of new Angular router API: There are many Dart file changes (too many to list all here) including:
    • APP_BASE_HREFappBaseHref
    • ROUTER_DIRECTIVESrouterDirectives
    • ROUTER_PROVIDERSrouterProviders, and provide through runApp() (recommended)
  • Other Dart file changes:
    • CORE_DIRECTIVEScoreDirectives
    • COMMON_PIPEScommonPipes
    • Template-syntax example changes due to the deprecation of QueryList
      • Replaced QueryList<T> with List<T>
      • Switched to using setter to detect changes to view children (@ViewChildren())

Dart 2 specific changes:

  • Dart file changes:
    • Dropped new keywords
    • Dropped unnecessary const keywords
    • Replaced Future<Null> with Future<void>

Angular doc changes:

  • Added a description of @Component export parameters to the Template Syntax page.
  • Component Styles: dropped “Template inline styles” and “Template link tags” section since both forms of template styling are now ignored.

More information:

HTML library tour (December 2017)

We’ve moved the dart:html section from the Dart library tour to a new home on this site: A Tour of the dart:html Library.

Forms (October 2017)

Updated the forms page and its example app to use custom CSS classes instead of the ng-* classes associated with the deprecated NgControlStatus.

Router HashLocationStrategy (October 2017)

Switched to using HashLocationStrategy in the Router example and the Tutorial.

In this way, features like deep linking into the example apps work as expected when no server-side support is available (such as with GitHub Pages and with pub serve, which is often used during app development). For details, see Which location strategy to use.

AngularDart 4.0.0 (August 2017)

All pubspecs and imports changed, as well as API doc URLs, due to the angular2 package changing its name to angular.

  • Updated package versions in pubspec.yaml:
    • angular: ^3.1.0^4.0.0
    • angular_components: ^0.5.3^0.6.0
    • angular_test: ^1.0.0-beta^1.0.0
    • Added angular_forms: ^1.0.0 for examples using forms
    • Added angular_router: ^1.0.0 for examples using the router
  • Updated transformers in pubspec.yaml:
    • angular2angular
    • Removed resolved_identifiers entry from the angular transformer
    • Removed reflection_remover transformer entry
    • Added test/**_test.dart as an angular: entry_points: for examples with component tests
  • Changed imports in Dart files:
    • angular2/angular2.dartangular/angular.dart
    • angular2/common.dartangular/angular.dart
    • angular2/platform/browser.dartangular/angular.dart
    • angular2/platform/common.dartangular/angular.dart
    • angular2/router.dartangular_router/angular_router.dart
    • Added angular_forms/angular_forms.dart to files using formDirectives
  • Other Dart file changes:
    • FORM_DIRECTIVESformDirectives
    • const Provider(x,y)const Provider<T>(x,y) for a provider of T instances; this is a first step towards strongly-typed providers
    • Changed ElementRef to Element, which requires an import of dart:html
    • Changed the CSS pseudo selector /deep/ to ::ng-deep
    • Changed a component (PR#950) to use the new exports parameter of @Component (RFC#374) to export enums to the component template
    • Switched from the use of @Component inputs and outputs parameters to appropriate @Input() and @Output() annotations.
    • Switched from the use of <glyph> (GlyphComponent) to <material-icon> (MaterialIconComponent)
  • Changed API doc URLs
    • The angular2angular change affected API doc URLs.
      Example: …/angular2/NgFor-class → …/angular/NgFor-class
    • angular2angular_forms for forms API elements, such as formDirectives
    • angular2angular_router for router API elements, such as Route
  • Removed documentation for native view encapsulation since it is no longer supported.

More information:

API reference (August 2017)

The API entries from both the angular and angular_components packages have been combined into a single unified API reference.

Testing docs, part 2 (August 2017)

Created several test-related pages. The original page, Testing, is now mostly a table of contents.

All of these pages are drafts, and we’d appreciate your feedback.

API doc changes (July 2017)

Because common.dart is going away in 4.0, we changed API doc generation. We also fixed some bugs in the API doc homepage and added import information for each library.

  • angular2.commonangular2
    Example: …/angular2.common/NgFor-class → …/angular2/NgFor-class
  • The API doc homepage now shows an import statement next to each library’s heading.

Dart 1.24 (June 2017)

We did initial work to prepare the examples to use the Dart development compiler (dartdevc):

  • Updated pubspec.yaml to make dartdevc the default development compiler.
  • Moved most implementation Dart files under lib/src/*, instead of lib/*, to improve dartdevc performance.

More information:

AngularDart 3.1 (May 2017)

The examples changed to update the release and reflect new recommendations.

  • Replaced core.dart imports: angular2/core.dartangular2/angular2.dart
  • Updated angular2.core API doc references. Example: …/angular2.core/OnInit-class → …/angular2/OnInit-class
  • To prepare for 3.1’s experimental compiler, in each example:
    • Removed platform_directives from pubspec.yaml, moving the directives it listed to the relevant components’ directives lists.
    • Removed platform_pipes from pubspec.yaml, moving COMMON_PIPES to the relevant components’ pipes lists.
  • Updated the angular2 dependency in each example’s pubspec: ^3.0.0^3.1.0.

Here’s an example of moving the directive and pipe lists:

# OLD: pubspec.yaml
- angular2:
    - 'package:angular2/common.dart#CORE_DIRECTIVES'
    - 'package:angular2/common.dart#COMMON_PIPES'
// NEW: Dart component file
  directives: const [CORE_DIRECTIVES],
  pipes: const [COMMON_PIPES])


More information:

Testing doc and code, part 1 (March-April 2017)

Created an initial Testing page and added component tests to the tutorial examples.

Pubspec updates:

  • Added angular_test and test to the dev_dependencies list.
  • Added the reflection_remover and pub_serve transformers.

More information: