Fix @Input annotations to work with setter methods in dart, and fix @Output
annotations to work with getter methods in Dart when using transformers.
Closes#5251Closes#5259
After discussing it we decided that PLATFORM_ is a better prefix for directives available everywhere in the app.
BREAKING CHANGE
AMBIENT_DIRECTIVES -> PLATFORM_DIRECTIVES
AMBIENT_PIPES -> PLATFORM_PIPES
Closes#5201
This is part of ongoing work to make core platform-independent.
BREAKING CHANGE
All private exports from 'angular2/src/core/facade/{lang,collection,exception_handler}' should be replaced with 'angular2/src/facade/{lang,collection,exception_handler}'.
BREAKING CHANGE
All private exports from 'angular2/src/core/{directives,pipes,forms}' should be replaced with 'angular2/src/common/{directives,pipes,formis}'
Closes#5153
Store dependency import information in a dedicated list in `NgDepsModel`
rather than as a boolean field on `ImportModel`. An `ImportModel` should
not "care" whether it is a .ng_deps.dart import or not -- this
information belongs in `NgDepsModel`.
This simplifies some of the logic around how `NgDepsModel` imports are
processed and eventually output.
- Move zone-related code out of logger.dart and into zone.dart.
- Rename `logger` => `log`.
- Add the ability to specify a zone-local `TemplateCompiler`.
The template compiler update removed the option to run the transformer
without generating change detectors and deprecated the
`generate_change_detectors` transformer parameter.
Now that it has been deprecated for several weeks, remove it from the
transformer code.
Forward `reflectPropertiesAsAttributes` => `reflect_properties_as_attributes`
and add a deprecation warning to `reflectPropertiesAsAttributes`.
Closes#4433
- Changes the `alreadyChecked` flag of AbstractChangeDetector to a new `state` flag.
- Changes all checks of alreadyChecked to check that the state is NeverChecked.
- Set state to Errored if an error is thrown during detection.
- Skip change detection for a detector and its children when the state is Errored.
- Add a test to validate this fixes issue #4323.
Closes#4953
Match [ViewResolver][]'s semantics for reading template and style values
from `@Component` and `@View` annotations.
We now warn if template and/or style values appear on an `@Component`
annotation and a `@View` annotation is present.
[ViewResolver]: 7c6130c2c5/modules/angular2/src/core/linker/view_resolver.ts
Previously, importing a library twice using different prefixes could
cause the template compiler step to incorrect omit `Directive`
dependencies provided by that library.
Previously, we parsed dependencies out of a the stringified value of
`directives`, which is brittle and error-prone.
Move this parsing into `DirectiveProcessor` where we have the full Dart
ast to help.
Previously, `DeferredRewriter` checked for the existence of
`.ng_deps.dart` files to determine which deferred libraries it needed to
rewrite, requiring that those assets exist at the time it was run.
Update to check for `.ng_meta.json` files instead, which exist after the
`DirectiveProcessor` phase. This allows the `DeferredRewriter` (which
only processes *.dart files) to run in
parallel with `TemplateComplier` (which only processes *.ng_meta.json
files) and `StylesheetCompiler` (which only processes *.css files).
Have DeferredRewriter to check existence of .ng_meta.json assets rather than .ng_deps.dart assets
Update `DirectiveProcessor` and `TemplateCompiler` to generate the
getters, setters, and methods currently generated in `BindGenerator`.
Update `DirectiveMetadataLinker` to output `.ng_meta.json` files instead
of `.ng_deps.dart` files, avoiding full codegen until the last phase.
This allows us to dedupe codegen logic and remove an additional phase
from the transformer.
The directory contains code authored in a style that makes it transpilable to dart. As such, these are not idiomatic examples of Angular 2 usage.
The main purpose of this directory is to enable experimentation with Angular within the angular/angular repository.
Closes#4342Closes#4639
Now that we can specify `directives` in either `@View` or `@Component`,
we will try to parse from both.
Previously, we would trash any `directives` parsed in the first
annotation upon encountering the second annotation. This ensures that we
maintain that list of `directives` regardless of annotation ordering.
Handle the situation where a `.dart` file generates a `.ng_meta.json`
file but does not register any reflective information.
An example of this would be a file that defines a const list that looks
like a directive alias. The transformer keeps track of this, and creates
a `.ng_meta.json` file but never creates a `.ng_deps.dart` file, which
can result in other files being linked to it and it not defining an
`initReflector` method.
`DeferredRewriter` depends on the presence of `.ng_deps.dart` files,
which do not yet exist in the phase where it was previously run.
Update the transformer phases to fix this and add an integration test to
prevent regression.