angular-cn/modules
George Kalpakas 07122f0ad9 fix(upgrade): populate upgraded component's view before creating the controller (#14289)
Previously, the relative order of the AngularJS compiling/linking operations was
not similar to AngularJS's, resulting in inconsistent behavior for upgraded
components (which made upgrading to Angular less straight forward).

This commit fixes it, by following the compiling/linking process of AngularJS
more closely.

Main differences:

- The components view is already populated when the controller is instantiated
  (and subsequent hooks are called).
- The correct DOM content is available when running the `$onChanges`, `$onInit`,
  `$doCheck` hooks. Previously, the "content children" were still present, not
  the "view children".
- The same for pre-linking.
- The template is compiled in the correct DOM context (e.g. has access to
  ancestors). Previously, it was compiled in isolation, inside a dummy element.

For reference, here is the order of operations:

**Before**

1. Compile template
2. Instantiate controller
3. Hook: $onChanges
4. Hook: $onInit
5. Hook: $doCheck
6. Pre-linking
7. Collect content children
8. Insert compiled template
9. Linking
10. Post-linking
11. Hook: $postLink

**After**

1. Collect content children
2. Insert template
3. Compile template
4. Instantiate controller
5. Hook: $onChanges
6. Hook: $onInit
7. Hook: $doCheck
8. Pre-linking
9. Linking
10. Post-linking
11. Hook: $postLink

Fixes #13912
2017-03-07 09:32:52 -08:00
..
@angular fix(upgrade): populate upgraded component's view before creating the controller (#14289) 2017-03-07 09:32:52 -08:00
angular1_router docs: branding fixes (#14132) 2017-01-27 15:03:11 -06:00
benchmarks refactor: remove lang.ts (#14837) 2017-03-06 15:22:29 -08:00
benchmarks_external refactor(): use const and let instead of var 2016-11-12 16:40:17 -08:00
e2e_util feat(core): add initial view engine (#14014) 2017-01-20 13:10:57 -08:00
payload_tests/hello_world/ts docs: branding fixes (#14132) 2017-01-27 15:03:11 -06:00
playground refactor(core): enable new animations dsl 2017-02-23 13:59:16 -08:00
rollup-test feat: update RxJS peer dependency to 5.0.0-rc.4 2016-11-29 16:27:33 -08:00
empty.ts chore(tslint): update tslint to 4.x (#13603) 2016-12-27 14:55:58 -08:00
es6-subset.d.ts chore(typings): restrict Angular to es5+collections+promise 2016-06-27 13:58:59 -07:00
system.d.ts fix(build): Remove duplicate System declarations (#10713) 2016-08-11 19:37:01 -07:00
tsconfig.json refactor(core): don’t use switch fall through but rather multiple `if`s 2017-02-21 09:12:21 -08:00
types.d.ts build(examples): upgrade to protractor 4.0.9 (#12803) 2016-11-10 18:13:11 -08:00