This change moves many APIs to the angular2/core export.
This change also automatically adds FORM_BINDINGS in
the application root injector.
BREAKING CHANGE:
Many dependencies that were previously exported from specific
APIs are now exported from angular2/core. Affected exports, which
should now be included from angular2/core include:
angular2/forms
angular2/di
angular2/directives
angular2/change_detection
angular2/bootstrap (except for dart users)
angular2/render
angular2/metadata
angular2/debug
angular2/pipes
Closes#3977
This requires delicate handling of type definitions which collide, because
we use TypeScript-provided lib.d.ts for --target=es5 and lib.es6.d.ts for
--target=es6.
We need to include our polyfill typings only in the --target=es5 case,
and the usages have to be consistent with lib.es6.d.ts.
Also starting with this change we now typecheck additional modules,
so this fixes a bunch of wrong typings which were never checked before.
Fixes#3178
BREAKING CHANGE:
Replace @Ancestor() with @Host() @SkipSelf()
Replace @Unbounded() wwith @SkipSelf()
Replace @Ancestor({self:true}) with @Host()
Replace @Unbounded({self:true}) with nothing
Replace new AncestorMetadata() with [new HostMetadata(), new SkipSelfMetadata()]
Replace new UnboundedMetadata() with new SkipSelfMetadata()
Replace new Ancestor({self:true}) with new HostMetadata()
BREAKING CHANGES:
- `ShadowDomStrategy` was removed. To specify the encapsulation of a component use `@View(encapsulation: ViewEncapsulation.NONE | ViewEncapsulation.EMULATED | ViewEncapsulation.NATIVE)`
- The default encapsulation strategy is now `ViewEncapsulation.EMULATED` if a component contains styles and `ViewEncapsulation.NONE` if it does not. Before this was always `NONE`.
- `ViewLoader` now returns the template as a string and the styles as a separate array
BREAKING CHANGE
The @Parent annotation has been removed. Use @Ancestor instead.
@Parent was used to enforce a particular DOM structure (e.g., a pane component is a direct child of the tabs component).
DI is not the right mechanism to do it. We should enforce it using schema instead.
Closes#2529
BREAKING CHANGES:
- shadow dom emulation no longer
supports the `<content>` tag. Use the new `<ng-content>` instead
(works with all shadow dom strategies).
- removed `DomRenderer.setViewRootNodes` and `AppViewManager.getComponentView`
-> use `DomRenderer.getNativeElementSync(elementRef)` and change shadow dom directly
- the `Renderer` interface has changed:
* `createView` now also has to support sub views
* the notion of a container has been removed. Instead, the renderer has
to implement methods to attach views next to elements or other views.
* a RenderView now contains multiple RenderFragments. Fragments
are used to move DOM nodes around.
Internal changes / design changes:
- Introduce notion of view fragments on render side
- DomProtoViews and DomViews on render side are merged,
AppProtoViews are not merged, AppViews are partially merged
(they share arrays with the other merged AppViews but we keep
individual AppView instances for now).
- DomProtoViews always have a `<template>` element as root
* needed for storing subviews
* we have less chunks of DOM to clone now
- remove fake ElementBinder / Bound element for root text bindings
and model them explicitly. This removes a lot of special cases we had!
- AppView shares data with nested component views
- some methods in AppViewManager (create, hydrate, dehydrate) are iterative now
* now possible as we have all child AppViews / ElementRefs already in an array!
BREAKING CHANGES:
- host actions don't take an expression as value any more but only a method name,
and assumes to get an array via the EventEmitter with the method arguments.
- Renderer.setElementProperty does not take `style.`/... prefixes any more.
Use the new methods `Renderer.setElementAttribute`, ... instead
Part of #2476Closes#2637
These wrappers are not natively understood by
ts2dart. Removing them will improve Dart2JS
compilation due to fewer megamorphic calls to List
functions.
It also makes Angular code more succinct and
improves type safety in Angular due to better type
inference of the Array component type.
This change exposed several bugs in Angular.
Closes#2472Closes#2339
BREAKING CHANGE
- `Compiler.compile` has been removed, the only way to compile
components dynamically is via `Compiler.compileInHost`
- `DynamicComponentLoader.loadIntoExistingLocation` has changed:
* renamed into `loadIntoLocation`
* will always create the host element as well
* requires an element with a variable inside of the host component view
next to which it will load new component.
- `DynamicComponentLoader.loadNextToExistingLocation` was renamed into
`DynamicComponentLoader.loadNextToLocation`
- `DynamicComponentLoader.loadIntoNewLocation` is removed
* use `DynamicComponentLoader.loadNextToLocation` instead
and then move the view nodes
manually around via `DomRenderer.getRootNodes()`
- `AppViewManager.{create,destroy}Free{Host,Embedded}View` was removed
* use `AppViewManager.createViewInContainer` and then move the view nodes
manually around via `DomRenderer.getRootNodes()`
- `Renderer.detachFreeView` was removed. Use `DomRenderer.getRootNodes()`
to get the root nodes of a view and detach them manually.
clang-format 1.0.17 substantially improves formatting for fat arrow functions
and array literal detection. It also fixes a number of minor formatting issues.
Free embedded views are view instances that are created
logically in the same was as views of a ViewContainer,
but their dom nodes are not attached.
BREAKING CHANGE:
- `Renderer.detachFreeHostView` was renamed to
`Renderer.detachFreeView`
- `DomRenderer.getHostElement()` was generalized into
`DomRenderer.getRootNodes()`
BREAKING CHANGE:
`AppViewManager.createInPlaceHostView` is replaced by
`AppViewManager.createRootHostView` (for bootstrap) and
`AppViewManager.createFreeHostView` (for imperative components).
The later creates new host elements that are not attached anywhere.
To attach them, use `DomRenderer.getHostElement(hostviewRef)`
to get the host element.
Closes#1920
The goal is to make implementing a renderer straight forward.
BREAKING_CHANGE:
- Renderer interface was redone / simplified.
- `DirectDomRenderer` was replaced by `DomRenderer`.
- `DirectDomRenderer.setImperativeComponentRootNodes` is replaced
by the following 2 steps:
1. `ViewManager.getComponentView(elementRef) -> ViewRef`
2. `DomRenderer.setComponentViewRootNodes(viewRef, rootNodes)`
- all `@View` annotations need to have a template, but the template
may be empty. Previously views that had a `renderer` property did
not have to have a `template`.
- `dynamicComponentLoader.loadIntoNewLocation` does no more allow
to pass an element, but requires a css selector.
Special syntax: `:document` can be used as prefix to search globally
on the document instead of in the provided parent view.
Part of #1675
In 'angular2/di' the symbol:
- Inject is a decorator
- InjectAnnotation is an annotation
Internally one an get a hold of annotations without *Annotations appened
(to make ts2dart work without workarounds) by importing from
'angular2/src/di/annotations_impl' instead of 'angular2/di'. This is
needed only for users that transpile through TS and through ts2dart.