2.0.0-beta.17 released [Breaking Changes]

angular2 logo

Angular team released another beta this week, which unfortunately has some breaking changes. This is normal and should be expected if you areĀ building apps with beta frameworks.

BREAKING CHANGES

The reference #... now always means ref-.

Before:

  • Outside of ngFor, a #... meant a reference.
  • Inside of ngFor, it meant a local variable.

This was pattern was confusing.

After:

  • <template #abc> now defines a reference to a TemplateRef, instead of an input variable used inside of the template.
  • Inside of structural directives that declare local variables, such as *ngFor, usage of #... is deprecated. Use letinstead.
    • <div *ngFor="#item of items"> now becomes <div *ngFor="let item of items">
  • var-... is deprecated.
    • use # or a ref- outside of *ngFor
    • for ngFor, use the syntax: <template ngFor let-... [ngForOf]="...">

Bug Fixes

  • changelog: fix changelog script. (c209836)
  • compiler: Allow templates to access variables that are declared afterwards. (1e8864c), closes #8261
  • core: properly evaluate expressions with conditional and boolean operators (1ad2a02), closes #8235 #8244 #8282
  • metadata: Do not attach module names to metadata. (d964888), closes #8225 #8082 #8256
  • testing: allow test component builder to override directives from lists (ff2ae7a), closes #7397 #8217

Features

  • compiler: ElementSchema now has explicit DOM schema information (d327ac4), closes #8179
  • core: separate refs from vars. (d2efac1), closes #7158 #8264

Leave a Reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.