- Full support for content projection in downgraded Angular 2
components. In particular, this enables multi-slot projection and
other features on <ng-content>.
- Correctly wire up hierarchical injectors for downgraded Angular 2
components: downgraded components inherit the injector of the first
other downgraded Angular 2 component they find up the DOM tree.
Closes#6629, #7727, #8729, #9643, #9649, #12675
## Inheritance Semantics:
Decorators:
1) list the decorators of the class and its parents in the ancestor first order
2) only use the last decorator of each kind (e.g. @Component / ...)
Constructor parameters:
If a class inherits from a parent class and does not declare
a constructor, it inherits the parent class constructor,
and with it the parameter metadata of that parent class.
Lifecycle hooks:
Follow the normal class inheritance model,
i.e. lifecycle hooks of parent classes will be called
even if the method is not overwritten in the child class.
## Example
E.g. the following is a valid use of inheritance and it will
also inherit all metadata:
```
@Directive({selector: 'someDir'})
class ParentDirective {
constructor(someDep: SomeDep) {}
ngOnInit() {}
}
class ChildDirective extends ParentDirective {}
```
Closes#11606Closes#12892
This improves ergonomics a bit by allowing people to write:
`<label [for]="ctxProp"></label>`.
This is similar to the existing class -> className mapping.
Closes#7516
This patch ensures that animations are run outside of change detection
thus allowing for start and done callbacks to modify application data
without causing a cycle loop.
Closes#12713
Previously, if a `TemplateRef` was created in a `ViewContainerRef`
at a different place, the content was not query able at all.
With this change, the content of the template can be queried
as if it was stamped out at the declaration place of the template.
E.g. in the following example, the `QueryList<ChildCmp>` will
be filled once the button is clicked.
```
@Component({
selector: ‘my-comp’,
template: ‘<button #vc (click)=“createView()”></button>’
})
class MyComp {
@ContentChildren(ChildCmp)
children: QueryList<ChildCmp>;
@ContentChildren(TemplateRef)
template: TemplateRef;
@ViewChild(‘vc’, {read: ViewContainerRef})
vc: ViewContainerRef;
createView() {
this.vc.createEmbeddedView(this.template);
}
}
@Component({
template: `
<my-comp>
<template><child-cmp></child-cmp></template>
</my-comp>
`
})
class App {}
```
Closes#12283Closes#12094
But use the DOM apis directly.
This also creates a separate `ServerRenderer` implementation
for `platform-server` as it previously reused the `BrowserRenderer`.