Major changes:
- `compiler.compileRoot(el, type)`
-> `compiler.compileInHost(type) + viewHydrator.hydrateHostViewInPlace(el, view)`
- move all `hydrate`/`dehydrate` methods out of `View` and `ViewContainer` into
a standalone class `view_hydrator` as private methods and provide new public
methods dedicated to the individual use cases.
Note: This PR does not change the current functionality, only moves it
into different places.
See design discussion in #1351, in preparation for imperative views.
Add two factory static functions to Injector: resolveAndCreate and
fromResolvedBindings.
We want to avoid resolution and flattening every time we create a new
injector. This commit allows the user to cache resolved bindings and
reuse them.
Queries allow a directive to inject a live list of directives of a given
type from its LightDom. The injected list is Iterable (in JS and Dart).
It will be Observable when Observables are support in JS, for now it
maintains a simple list of onChange callbacks API.
To support queries, element injectors now maintain a list of
child injectors in the correct DOM order (dynamically updated by
viewports).
For performance reasons we allow only 3 active queries in an injector
subtree. The feature adds no overhead to the application when not
used. Queries walk the injector tree only during dynamic view
addition/removal as triggered by viewport directives.
Syncs changes between viewContainer on the render and logic sides.
Closes#792
Introduces angular2/src/core/compiler/ViewFactory which
extracts ProtoView.instantiate and replaces ViewPool.
Note: This is a work in progress commit to unblock other commits.
There will be follow ups to add unit tests, remove TODOs, …
Needed to change Renderer.mergeChildComponentProtoViews to not create
new ProtoViews to be able to deal with cyclic references.
This commit is part of using the new render layer in Angular.
Based on the discussion in #776 we can't reliably check if a given
element has a particular property at the compilation time. As such
the existing algorithm detecting "missing" directives can't be used.
We need to see if there is a different / better algorithm or maybe
those checks need to be moved later in the process (runtime). Leaving
integration tests in place (disabled) so we can come back to the
topic after unblocking the situation.
This commit effectivelly reverts 94e203b9df