@ -5,7 +5,6 @@ import {ListWrapper, List} from 'angular2/src/facade/collection';
|
||||
export class Directive {
|
||||
selector:any; //string;
|
||||
bind:any;
|
||||
lightDomServices:any; //List;
|
||||
implementsTypes:any; //List;
|
||||
lifecycle:any; //List
|
||||
events:any; //List
|
||||
@ -14,20 +13,17 @@ export class Directive {
|
||||
selector,
|
||||
bind,
|
||||
events,
|
||||
lightDomServices,
|
||||
implementsTypes,
|
||||
lifecycle
|
||||
}:{
|
||||
selector:string,
|
||||
bind:any,
|
||||
events: any,
|
||||
lightDomServices:List,
|
||||
implementsTypes:List,
|
||||
lifecycle:List
|
||||
}={})
|
||||
{
|
||||
this.selector = selector;
|
||||
this.lightDomServices = lightDomServices;
|
||||
this.implementsTypes = implementsTypes;
|
||||
this.bind = bind;
|
||||
this.events = events;
|
||||
@ -41,26 +37,21 @@ export class Directive {
|
||||
|
||||
export class Component extends Directive {
|
||||
//TODO: vsavkin: uncomment it once the issue with defining fields in a sublass works
|
||||
shadowDomServices:any; //List;
|
||||
componentServices:any; //List;
|
||||
services:any; //List;
|
||||
|
||||
@CONST()
|
||||
constructor({
|
||||
selector,
|
||||
bind,
|
||||
events,
|
||||
lightDomServices,
|
||||
shadowDomServices,
|
||||
componentServices,
|
||||
services,
|
||||
implementsTypes,
|
||||
lifecycle
|
||||
}:{
|
||||
selector:String,
|
||||
bind:Object,
|
||||
events:Object,
|
||||
lightDomServices:List,
|
||||
shadowDomServices:List,
|
||||
componentServices:List,
|
||||
services:List,
|
||||
implementsTypes:List,
|
||||
lifecycle:List
|
||||
}={})
|
||||
@ -69,13 +60,11 @@ export class Component extends Directive {
|
||||
selector: selector,
|
||||
bind: bind,
|
||||
events: events,
|
||||
lightDomServices: lightDomServices,
|
||||
implementsTypes: implementsTypes,
|
||||
lifecycle: lifecycle
|
||||
});
|
||||
|
||||
this.shadowDomServices = shadowDomServices;
|
||||
this.componentServices = componentServices;
|
||||
this.services = services;
|
||||
}
|
||||
}
|
||||
|
||||
@ -86,7 +75,6 @@ export class Decorator extends Directive {
|
||||
selector,
|
||||
bind,
|
||||
events,
|
||||
lightDomServices,
|
||||
implementsTypes,
|
||||
lifecycle,
|
||||
compileChildren = true,
|
||||
@ -94,7 +82,6 @@ export class Decorator extends Directive {
|
||||
selector:string,
|
||||
bind:any,
|
||||
events:any,
|
||||
lightDomServices:List,
|
||||
implementsTypes:List,
|
||||
lifecycle:List,
|
||||
compileChildren:boolean
|
||||
@ -105,7 +92,6 @@ export class Decorator extends Directive {
|
||||
selector: selector,
|
||||
bind: bind,
|
||||
events: events,
|
||||
lightDomServices: lightDomServices,
|
||||
implementsTypes: implementsTypes,
|
||||
lifecycle: lifecycle
|
||||
});
|
||||
@ -118,13 +104,11 @@ export class Viewport extends Directive {
|
||||
selector,
|
||||
bind,
|
||||
events,
|
||||
lightDomServices,
|
||||
implementsTypes,
|
||||
lifecycle
|
||||
}:{
|
||||
selector:string,
|
||||
bind:any,
|
||||
lightDomServices:List,
|
||||
implementsTypes:List,
|
||||
lifecycle:List
|
||||
}={})
|
||||
@ -133,7 +117,6 @@ export class Viewport extends Directive {
|
||||
selector: selector,
|
||||
bind: bind,
|
||||
events: events,
|
||||
lightDomServices: lightDomServices,
|
||||
implementsTypes: implementsTypes,
|
||||
lifecycle: lifecycle
|
||||
});
|
||||
|
4
modules/angular2/src/core/application.js
vendored
4
modules/angular2/src/core/application.js
vendored
@ -43,9 +43,7 @@ function _injectorBindings(appComponentType): List<Binding> {
|
||||
return [
|
||||
bind(appDocumentToken).toValue(DOM.defaultDoc()),
|
||||
bind(appComponentAnnotatedTypeToken).toFactory((reader) => {
|
||||
// TODO(rado): inspect annotation here and warn if there are bindings,
|
||||
// lightDomServices, and other component annotations that are skipped
|
||||
// for bootstrapping components.
|
||||
// TODO(rado): investigate whether to support bindings on root component.
|
||||
return reader.read(appComponentType);
|
||||
}, [DirectiveMetadataReader]),
|
||||
|
||||
|
@ -34,9 +34,6 @@ export class ProtoElementInjectorBuilder extends CompileStep {
|
||||
var distanceToParentInjector = this._getDistanceToParentInjector(parent, current);
|
||||
var parentProtoElementInjector = this._getParentProtoElementInjector(parent, current);
|
||||
var injectorBindings = ListWrapper.map(current.getAllDirectives(), this._createBinding);
|
||||
// TODO: add lightDomServices as well,
|
||||
// but after the directives as we rely on that order
|
||||
// in the element_binder_builder.
|
||||
|
||||
// Create a protoElementInjector for any element that either has bindings *or* has one
|
||||
// or more var- defined. Elements with a var- defined need a their own element injector
|
||||
|
2
modules/angular2/src/core/compiler/view.js
vendored
2
modules/angular2/src/core/compiler/view.js
vendored
@ -144,7 +144,7 @@ export class View {
|
||||
|
||||
// shadowDomAppInjector
|
||||
if (isPresent(componentDirective)) {
|
||||
var services = componentDirective.annotation.componentServices;
|
||||
var services = componentDirective.annotation.services;
|
||||
if (isPresent(services))
|
||||
shadowDomAppInjector = appInjector.createChild(services);
|
||||
else {
|
||||
|
Reference in New Issue
Block a user