refactor(annotations): replace Module functions with plain lists.

Renames:
elementServices -> shadowDomServices.
This commit is contained in:
Rado Kirov 2014-11-14 12:41:05 -08:00
parent 1b79c91320
commit b8e3617a1d
6 changed files with 22 additions and 38 deletions

View File

@ -6,19 +6,19 @@ export class Component extends Directive {
constructor({ constructor({
selector, selector,
bind, bind,
lightDomServices,
implementsTypes,
template, template,
elementServices, lightDomServices,
componentServices shadowDomServices,
componentServices,
implementsTypes
}:{ }:{
selector:String, selector:String,
bind:Object, bind:Object,
template:TemplateConfig, template:TemplateConfig,
lightDomServices:DomServicesFunction, lightDomServices:List,
shadowDomServices:DomServicesFunction, shadowDomServices:List,
componentServices:Array, componentServices:List,
implementsTypes:Array<Type> implementsTypes:List
}={}) }={})
{ {
super({ super({
@ -27,7 +27,8 @@ export class Component extends Directive {
lightDomServices: lightDomServices, lightDomServices: lightDomServices,
implementsTypes: implementsTypes}); implementsTypes: implementsTypes});
this.template = template; this.template = template;
this.elementServices = elementServices; this.lightDomServices = lightDomServices;
this.shadowDomServices = shadowDomServices;
this.componentServices = componentServices; this.componentServices = componentServices;
} }
} }
@ -45,18 +46,11 @@ import 'package:angular/core.dart' as core;
directives: const [CompA], directives: const [CompA],
formatters: const [Stringify] formatters: const [Stringify]
), ),
componentServices: Example.componentServices, componentServices: [...],
elementServices: Example.elementServices, shadowDomServices: [...]
implementsTypes: const [App] implementsTypes: const [App]
) )
class Example implements App { class Example implements App {}
static componentServices(Module m) {
m.bind();
}
static elementServices(ElementModule m) {
m.bind();
}
}
class CompA {} class CompA {}

View File

@ -11,8 +11,8 @@ export class Decorator extends Directive {
}:{ }:{
selector:String, selector:String,
bind:Object, bind:Object,
lightDomServices:ElementServicesFunction, lightDomServices:List,
implementsTypes:Array<Type> implementsTypes:List
}={}) }={})
{ {
super({ super({

View File

@ -1,6 +1,5 @@
// import {Type} from 'facade/lang';
// import {ElementServicesFunction} from './facade';
import {ABSTRACT, CONST} from 'facade/lang'; import {ABSTRACT, CONST} from 'facade/lang';
import {List} from 'facade/collection';
@ABSTRACT() @ABSTRACT()
@ -14,8 +13,8 @@ export class Directive {
}:{ }:{
selector:String, selector:String,
bind:Object, bind:Object,
lightDomServices:ElementServicesFunction, lightDomServices:List,
implementsTypes:Array<Type> implementsTypes:List
}) })
{ {
this.selector = selector; this.selector = selector;

View File

@ -1,7 +0,0 @@
library core.annotations.facade;
import 'package:di/di.dart' show Module;
import '../compiler/element_module.dart' show ElementModule;
typedef DomServicesFunction(ElementModule m);
typedef ComponentServicesFunction(Module m);

View File

@ -1,2 +0,0 @@
export var DomServicesFunction = Function;
export var ComponentServicesFunction = Function;

View File

@ -11,8 +11,8 @@ export class Template extends Directive {
}:{ }:{
selector:String, selector:String,
bind:Object, bind:Object,
lightDomServices:ElementServicesFunction, lightDomServices:List,
implementsTypes:Array<Type> implementsTypes:List
}={}) }={})
{ {
super({ super({