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

View File

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

View File

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