BREAKING CHANGE:
This change moves the http module into angular2/, so its import
path is now angular2/http instead of http/http.
Many other modules have also been moved around inside of angular2,
but the public API paths have not changed as of this commit.
Currently the transformer generates all getters and setters even when
creating pre-generated change detectors, which remove the need for them.
Generate getters and setters via the model provided by `ProtoViewDto`,
which contains enough information to allow omitting unnecessary getters
and setters from code output.
Allow generating getters, setters, and method names which are Dart
pseudo keywords.
Closes#3489
currently throwing an error
```error
Error during instantiation of LocationStrategy! (RouterLink -> Router
-> Location -> LocationStrategy).
ORIGINAL ERROR: TypeError: baseElement.attr is not a function
```
Closes#3214
Provide the ability to attach custom data onto a route and retrieve
that data as an injectable (RouteData) inside the component.
Closes#2777Closes#3541
BREAKING CHANGE (maybe)
Well as long as our customers use public API this should not be a
breaking change, but we have changed import structure as well as
internal names, so it could be breaking.
import:
angular2/annotations => angular2/metadata
Classes:
*Annotations => *Metadata
renderer.DirectiveMetadata => renderer.RendererDirectiveMetadata
renderer.ElementBinder => renderer.RendererElementBinder
impl.Directive => impl.DirectiveMetadata
impl.Component => impl.ComponentMetadata
impl.View => impl.ViewMetadata
Closes#3660
Fixes a bug in view manager util where sibling injector is not correctly
calculated.
ViewQuery no longer includes the view's initiating component injector.
Includes some refactoring of view methods and a removal of a polymorphic
map call.
Closes#3033Closes#3439
BREAKING CHANGE:
Instead of configuring pipes via a Pipes object, now you can configure them by providing the pipes property to the View decorator.
@Pipe({
name: 'double'
})
class DoublePipe {
transform(value, args) { return value * 2; }
}
@View({
template: '{{ 10 | double}}'
pipes: [DoublePipe]
})
class CustomComponent {}
Closes#3572
- Extends URLSearchParams API to include operations for combining
different URLSearchParams objects:
These new methods include:
setAll(otherParams): performs `this.set(key, values[0])` for each
key/value-list pair in `otherParams`
appendAll(otherParams): performs `this.append(key, values)` for
each key/value-list pair in `otherParams`
replaceAll(otherParams): for each key/value-list pair in
`otherParams`, replaces current set of values for `key` with
a copy of the list of values.
- RequestOptions do not merge search params automatically (because
there are multiple ways to do this). Instead, they replace any
existing `search` field if `search` is provided. Explicit merging
is required if merging is desirable.
- Some extra test coverage added.
Closes#2417Closes#3020
BREAKING CHANGE
- Pipe factories have been removed.
- PIpe names to pipe implementations are 1-to-1 instead of 1-to-*
Before:
class DateFormatter {
transform(date, args){}
}
class DateFormatterFactory {
supporst(obj) { return true; }
create(cdRef) { return new DateFormatter(); }
}
new Pipes({date: [new DateFormatterFactory()]})
After
class DateFormatter {
transform(date, args){}
}
new Pipes({date: DateFormatter})
BREAKING CHANGE:
The selector for the CSSClass directive was changed
from [class] to [ng-class]. The directive itself was
renamed from CSSClass to NgClass
Closes#3498
Formatting code requires time and memory during the build -- do not do
it unless explicitly requested via a parameter to the transformer.
Add an entry to the
[wiki](https://github.com/angular/angular/wiki/Angular-2-Dart-Transformer)
describing the added parameter.
Previously, the error messages coming out of the Dart transformer were
opaque when those errors came from the analyzer (for example, analyzer
parse errors). Log more useful errors when they are caught by the
transform code.
Previously I added parens everywhere to make this @proxy() because our typing indicated
it was a function that returned a decorator, but this breaks dart. Instead, the typing needs
to be changed.
Fixes#3494
Promise used to be typed as any, giving incorrect results. This change
fixes places that were incorrectly typed and re-exports the actual
Promise type from es6-promise.
It also fixes a series of compilation errors discovered/triggered by
this change.
BREAKING CHANGE
Previously, if an element had a property, Angular would update that property even if there was a directive placed on the same element with the same property. Now, the directive would have to explicitly update the native elmement by either using hostProperties or the renderer.
This change also makes us compliant with 1.6.0-dev compiler,
so we can do some experiments with apps that use 1.6 features
and compile against Angular.
We should probably add a travis build for 1.6 so we stay compatible
with both versions.
Introduces the injectable `TemplateCloner` that can be configured via the new token `MAX_IN_MEMORY_ELEMENTS_PER_TEMPLATE_TOKEN`.
Also replaces `document.adoptNode` with `document.importNode` as otherwise
custom elements are not triggered in chrome 43.
Closes#3418Closes#3433
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()
LifeCycle can now be imported via angular2/angular2 or
angular2/core, so that end users can inject it without
having to use the full source path.
Closes#3395
Also inserts comment nodes before/after projected nodes so that text nodes don’t get merged when we serialize/deserialize them.
Closes#3356
First part of #3364
Move the implementation of `(de)hydrate`, `hydrated`, and
`detectChangesInRecords` into `AbstractChangeDetector`.
Add comments clarifying the contract between `AbstractChangeDetector`
and its subclasses.
Closes#3245
Move fields common to Dynamic, Jit, and Pregen change detectors into the
`AbstractChangeDetector` superclass to save on codegen size and reduce
code duplication.
Update to #3248, closes#3243
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
Call new `(de)hydrateDirectives` methods from `(de)hydrate`. Add a null
implementation in `AbstractChangeDetector` and only override if
necessary for the specific change detector.
Update to #3248
Create `looseNotIdentical => !looseIdentical`, which will save a lot of
unnecessary '!' characters in generated change detectors.
Update to https://github.com/angular/angular/issues/3248
Previously, `uninitialized()` was a method, requiring a call as well as
two extra characters everywhere it was used.
Make this value a variable, saving the characters and avoiding the
method call to get its value.
This change also removes the export of `uninitialized` from
change_detect.ts, which is technically a breaking change, however
`uninitialized` is an implementation detail and nobody should be using
it in app logic. By convention, apps should not be importing from files
under `src/`.
Update to #3248.
Fixes#3001
BREAKING CHANGE:
View renderer used to take normalized CSS class names (ex. fooBar for foo-bar).
With this change a rendered implementation gets a calss name as specified in a
template, without any transformations / normalization. This change only affects
custom view renderers that should be updated accordingly.
Closes#3264