forked from angular/angular
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
refactor(compiler): use the new compiler everywhere
Closes angular#3605 BREAKING CHANGE: - we don't mark an element as bound any more if it only contains text bindings E.g. <div>{{hello}}</div> This changes the indices when using `DebugElement.componentViewChildren` / `DebugElement.children`. - `@Directive.compileChildren` was removed, `ng-non-bindable` is now builtin and not a directive any more - angular no more adds the `ng-binding` class to elements with bindings - directives are now ordered as they are listed in the View.directives regarding change detection. Previously they had an undefined order. - the `Renderer` interface has new methods `createProtoView` and `registerComponentTemplate`. See `DomRenderer` for default implementations. - reprojection with `ng-content` is now all or nothing per `ng-content` element - angular2 transformer can't be used in tests that modify directive metadata. Use `angular2/src/transform/inliner_for_test` transformer instead.
- Loading branch information
Showing
123 changed files
with
2,012 additions
and
3,451 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
import {Compiler, internalCreateProtoView} from 'angular2/src/core/compiler/compiler'; | ||
import {ProtoViewRef} from 'angular2/src/core/compiler/view_ref'; | ||
import {ProtoViewFactory} from 'angular2/src/core/compiler/proto_view_factory'; | ||
import {TemplateCompiler} from './template_compiler'; | ||
|
||
import {Injectable} from 'angular2/src/core/di'; | ||
import {Type} from 'angular2/src/core/facade/lang'; | ||
import {Promise, PromiseWrapper} from 'angular2/src/core/facade/async'; | ||
|
||
@Injectable() | ||
export class RuntimeCompiler extends Compiler { | ||
/** | ||
* @private | ||
*/ | ||
constructor(_protoViewFactory: ProtoViewFactory, private _templateCompiler: TemplateCompiler) { | ||
super(_protoViewFactory); | ||
} | ||
|
||
compileInHost(componentType: Type): Promise<ProtoViewRef> { | ||
return this._templateCompiler.compileHostComponentRuntime(componentType) | ||
.then(compiledHostTemplate => internalCreateProtoView(this, compiledHostTemplate)); | ||
} | ||
|
||
clearCache() { | ||
super.clearCache(); | ||
this._templateCompiler.clearCache(); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.