diff --git a/modules/core/src/annotations/component.js b/modules/core/src/annotations/component.js index c3c80e20fc..17d81b8c58 100644 --- a/modules/core/src/annotations/component.js +++ b/modules/core/src/annotations/component.js @@ -1,12 +1,15 @@ import {Directive} from './directive'; +import {ABSTRACT, CONST} from 'facade/lang'; export class Component extends Directive { + @CONST() constructor({ selector, + lightDomServices, + implementsTypes, template, elementServices, - componentServices, - implementsTypes + componentServices }:{ selector:String, template:TemplateConfig, @@ -16,7 +19,13 @@ export class Component extends Directive { implementsTypes:Array }) { - // super({selector, lightDomServices, implementsTypes}); + super({ + selector: selector, + lightDomServices: lightDomServices, + implementsTypes: implementsTypes}); + this.template = template; + this.elementServices = elementServices; + this.componentServices = componentServices; } } @@ -62,4 +71,4 @@ CompA ShadowDOM: CompB SHadowDOM:
-*/ \ No newline at end of file +*/ diff --git a/modules/core/src/annotations/directive.js b/modules/core/src/annotations/directive.js index c87d861014..bbeb0bdd92 100644 --- a/modules/core/src/annotations/directive.js +++ b/modules/core/src/annotations/directive.js @@ -1,21 +1,23 @@ // import {Type} from 'facade/lang'; // import {ElementServicesFunction} from './facade'; -import {ABSTRACT} from 'facade/lang'; +import {ABSTRACT, CONST} from 'facade/lang'; @ABSTRACT() export class Directive { - constructor({ + @CONST() + constructor({ selector, lightDomServices, implementsTypes - }/*:{ + }:{ selector:String, lightDomServices:ElementServicesFunction, implementsTypes:Array - }*/) + }) { + this.selector = selector; this.lightDomServices = lightDomServices; - this.selector = selector; - } + this.implementsTypes = implementsTypes; + } } diff --git a/modules/core/src/annotations/template_config.js b/modules/core/src/annotations/template_config.js index 48ac1a427a..e733165ae2 100644 --- a/modules/core/src/annotations/template_config.js +++ b/modules/core/src/annotations/template_config.js @@ -1,16 +1,23 @@ +import {ABSTRACT, CONST} from 'facade/lang'; // import {Type, List} from 'facade/lang'; export class TemplateConfig { + @CONST() constructor({ url, directives, formatters, source - }/*: { + }: { url: String, directives: List, formatters: List, source: List - }*/) - {} -} \ No newline at end of file + }) + { + this.url = url; + this.directives = directives; + this.formatters = formatters; + this.source = source; + } +}