|
23 | 23 |
|
24 | 24 | ### Features |
25 | 25 |
|
| 26 | +* **codegen:** produce `.ngfactory.dart/ts` files instead of `.template.dart/ts` files. ([c06b0a2](https://github.com/angular/angular/commit/c06b0a2)) |
| 27 | +* **core:** add `Query.read` and remove `DynamicComponentLoader.loadIntoLocation`. ([efbd446](https://github.com/angular/angular/commit/efbd446)) |
| 28 | +* **core:** introduce ComponentFactory. ([0c600cf](https://github.com/angular/angular/commit/0c600cf)) |
| 29 | +* **core:** separate reflective injector from Injector interface ([0a7d10b](https://github.com/angular/angular/commit/0a7d10b)) |
| 30 | +* **core:** support importUri in StaticReflector ([3e11422](https://github.com/angular/angular/commit/3e11422)), closes [#8195](https://github.com/angular/angular/issues/8195) |
| 31 | +* **core:** support non reflective bootstrap. ([9092ac7](https://github.com/angular/angular/commit/9092ac7)) |
26 | 32 | * **html_lexer:** support special forms used by i18n { exp, plural, =0 {} } ([7f29766](https://github.com/angular/angular/commit/7f29766)) |
27 | 33 | * **html_parser:** support special forms used by i18n { exp, plural, =0 {} } ([7c9717b](https://github.com/angular/angular/commit/7c9717b)) |
28 | 34 | * **i18n:** add custom placeholder names ([bb9fb21](https://github.com/angular/angular/commit/bb9fb21)), closes [#7799](https://github.com/angular/angular/issues/7799) [#8057](https://github.com/angular/angular/issues/8057) |
29 | 35 | * **i18n:** add support for nested expansion forms ([c6244d1](https://github.com/angular/angular/commit/c6244d1)), closes [#7977](https://github.com/angular/angular/issues/7977) |
30 | 36 | * **i18n:** support plural and gender special forms ([88b0a23](https://github.com/angular/angular/commit/88b0a23)) |
| 37 | +* **Location:** out of router and into platform/common ([b602bd8](https://github.com/angular/angular/commit/b602bd8)), closes [#7962](https://github.com/angular/angular/issues/7962) |
31 | 38 | * **NgTemplateOutlet:** add NgTemplateOutlet directive ([f4e6994](https://github.com/angular/angular/commit/f4e6994)), closes [#7615](https://github.com/angular/angular/issues/7615) [#8021](https://github.com/angular/angular/issues/8021) |
32 | 39 | * **router:** add Router and RouterOutlet ([5a897cf](https://github.com/angular/angular/commit/5a897cf)), closes [#8173](https://github.com/angular/angular/issues/8173) |
33 | 40 | * **router:** add router metadata ([ef67a0c](https://github.com/angular/angular/commit/ef67a0c)) |
|
36 | 43 | * **router:** implement RouterUrlParser ([f698567](https://github.com/angular/angular/commit/f698567)) |
37 | 44 | * **test:** Implement fakeAsync using the FakeAsyncTestZoneSpec from zone.js. ([bab81a9](https://github.com/angular/angular/commit/bab81a9)), closes [#8142](https://github.com/angular/angular/issues/8142) |
38 | 45 | * **tests:** manage asynchronous tests using zones ([8490921](https://github.com/angular/angular/commit/8490921)), closes [#7735](https://github.com/angular/angular/issues/7735) |
| 46 | +* **view_compiler:** codegen DI and Queries ([2b34c88](https://github.com/angular/angular/commit/2b34c88)), closes [#6301](https://github.com/angular/angular/issues/6301) [#6567](https://github.com/angular/angular/issues/6567) |
39 | 47 |
|
40 | 48 |
|
41 | 49 | ### BREAKING CHANGES |
42 | 50 |
|
| 51 | +* - pipes now take a variable number of arguments, and not an array that contains all arguments. |
| 52 | + |
| 53 | +* inject can no longer wrap fakeAsync while fakeAsync can wrap inject. So the order in existing tests with inject and fakeAsync has to be switched as follows: |
| 54 | +Before: |
| 55 | +``` |
| 56 | +inject([...], fakeAsync((...) => {...})) |
| 57 | +``` |
| 58 | +After: |
| 59 | +``` |
| 60 | +fakeAsync(inject([...], (...) => {...})) |
| 61 | +``` |
| 62 | +You will also need to add the dependency |
| 63 | +`'node_modules/zone.js/dist/fake-async-test.js'` |
| 64 | +as a served file in your Karma or other test configuration. |
| 65 | + |
| 66 | +* - Injector was renamed into `ReflectiveInjector`, |
| 67 | + as `Injector` is only an abstract class with one method on it |
| 68 | +- `Injector.getOptional()` was changed into `Injector.get(token, notFoundValue)` |
| 69 | + to make implementing injectors simpler |
| 70 | +- `ViewContainerRef.createComponent` now takes an `Injector` |
| 71 | + instead of `ResolvedProviders`. If a reflective injector |
| 72 | + should be used, create one before calling this method. |
| 73 | + (e.g. via `ReflectiveInjector.resolveAndCreate(…)`. |
| 74 | + |
| 75 | +* - `DynamicComponentLoader.loadIntoLocation` has been removed. Use `@ViewChild(‘myVar’, read: ViewContainerRef)` to get hold of a `ViewContainerRef` at an element with variable `myVar`. Then call `DynamicComponentLoader.loadNextToLocation`. |
| 76 | +- `DynamicComponentLoader.loadNextToLocation` now takes a `ViewContainerRef` instead of an `ElementRef`. |
| 77 | +- `AppViewManager` is renamed into `ViewUtils` and is a mere private utility service. |
| 78 | + |
| 79 | +* - `Compiler` is renamed to `ComponentResolver`, |
| 80 | + `Compiler.compileInHost` has been renamed to `ComponentResolver.resolveComponent`. |
| 81 | +- `ComponentRef.dispose` is renamed to `ComponentRef.destroy` |
| 82 | +- `ViewContainerRef.createHostView` is renamed to `ViewContainerRef.createComponent` |
| 83 | +- `ComponentFixture_` has been removed, the class `ComponentFixture` |
| 84 | + can now be created directly as it is no more using private APIs. |
| 85 | + |
| 86 | +* `Location` and other related providers have been moved out of `router` and into `platform/common`. `BrowserPlatformLocation` is not meant to be used directly however advanced configurations may use it via the following import change. |
| 87 | +Before: |
| 88 | +``` |
| 89 | +import { |
| 90 | + PlatformLocation, |
| 91 | + Location, |
| 92 | + LocationStrategy, |
| 93 | + HashLocationStrategy, |
| 94 | + PathLocationStrategy, |
| 95 | + APP_BASE_HREF} |
| 96 | +from 'angular2/router'; |
| 97 | +import {BrowserPlatformLocation} from 'angular2/src/router/location/browser_platform_location'; |
| 98 | +``` |
| 99 | +After: |
| 100 | +``` |
| 101 | +import { |
| 102 | + PlatformLocation, |
| 103 | + Location, |
| 104 | + LocationStrategy, |
| 105 | + HashLocationStrategy, |
| 106 | + PathLocationStrategy, |
| 107 | + APP_BASE_HREF} |
| 108 | +from 'angular2/platform/common'; |
| 109 | +import {BrowserPlatformLocation} from 'angular2/src/platform/browser/location/browser_platform_location'; |
| 110 | +``` |
| 111 | + |
43 | 112 | * `injectAsync` is now deprecated. Instead, use the `async` function |
44 | 113 | to wrap any asynchronous tests. |
45 | 114 |
|
@@ -67,21 +136,24 @@ it('should wait for returned promises', async(() => { |
67 | 136 | })); |
68 | 137 | ``` |
69 | 138 |
|
70 | | -* inject can no longer wrap fakeAsync while fakeAsync can wrap inject. So the order in existing tests with inject and fakeAsync has to be switched as follows: |
71 | | -Before: |
72 | | -``` |
73 | | -inject([...], fakeAsync((...) => {...})) |
74 | | -``` |
75 | | -After: |
76 | | -``` |
77 | | -fakeAsync(inject([...], (...) => {...})) |
78 | | -``` |
| 139 | +* - Renderer: |
| 140 | + * renderComponent method is removed form `Renderer`, only present on `RootRenderer` |
| 141 | + * Renderer.setDebugInfo is removed. Renderer.createElement / createText / createTemplateAnchor |
| 142 | + now take the DebugInfo directly. |
| 143 | +- Query semantics: |
| 144 | + * Queries don't work with dynamically loaded components. |
| 145 | + * e.g. for router-outlet: loaded components can't be queries via @ViewQuery, |
| 146 | + but router-outlet emits an event `activate` now that emits the activated component |
| 147 | +- Exception classes and the context inside changed (renamed fields) |
| 148 | +- DebugElement.attributes is an Object and not a Map in JS any more |
| 149 | +- ChangeDetectorGenConfig was renamed into CompilerConfig |
| 150 | +- AppViewManager.createEmbeddedViewInContainer / AppViewManager.createHostViewInContainer |
| 151 | + are removed, use the methods in ViewContainerRef instead |
| 152 | +- Change detection order changed: |
| 153 | + * 1. dirty check component inputs |
| 154 | + * 2. dirty check content children |
| 155 | + * 3. update render nodes |
79 | 156 |
|
80 | | -You will also need to add the dependency |
81 | | -`'node_modules/zone.js/dist/fake-async-test.js'` |
82 | | -as a served file in your Karma or other test configuration. |
83 | | - |
84 | | -* - pipes now take a variable number of arguments, and not an array that contains all arguments. |
85 | 157 |
|
86 | 158 |
|
87 | 159 | <a name="2.0.0-beta.15"></a> |
@@ -2621,4 +2693,3 @@ After |
2621 | 2693 | }) |
2622 | 2694 |
|
2623 | 2695 | * no longer cache ref |
2624 | | - |
|
0 commit comments