2014-09-30 14:56:33 -04:00
|
|
|
import {Type} from 'facade/lang';
|
2014-10-10 15:44:56 -04:00
|
|
|
import {Promise} from 'facade/async';
|
2014-09-19 16:38:37 -07:00
|
|
|
import {Element} from 'facade/dom';
|
2014-10-02 12:27:01 -07:00
|
|
|
//import {ProtoView} from './view';
|
2014-09-19 16:38:37 -07:00
|
|
|
import {TemplateLoader} from './template_loader';
|
2014-09-28 13:55:01 -07:00
|
|
|
import {FIELD} from 'facade/lang';
|
2014-09-19 23:03:36 +00:00
|
|
|
|
|
|
|
export class Compiler {
|
2014-09-19 16:38:37 -07:00
|
|
|
|
|
|
|
@FIELD('final _templateLoader:TemplateLoader')
|
|
|
|
constructor(templateLoader:TemplateLoader) {
|
|
|
|
this._templateLoader = templateLoader;
|
|
|
|
}
|
|
|
|
|
2014-09-19 23:03:36 +00:00
|
|
|
/**
|
2014-10-10 15:44:56 -04:00
|
|
|
* # Why promise?
|
2014-09-24 20:20:59 -07:00
|
|
|
* - compilation will load templates. Instantiating views before templates are loaded will
|
2014-09-19 23:03:36 +00:00
|
|
|
* complicate the Directive code. BENEFIT: view instantiation become synchrnous.
|
|
|
|
* # Why result that is independent of injector?
|
|
|
|
* - don't know about injector in deserialization
|
|
|
|
* - compile does not need the injector, only the ViewFactory does
|
|
|
|
*/
|
2014-10-10 15:44:56 -04:00
|
|
|
compile(component:Type, element:Element/* = null*/):Promise/*<ProtoView>*/ {
|
2014-09-19 16:38:37 -07:00
|
|
|
return null;
|
2014-09-19 23:03:36 +00:00
|
|
|
}
|
|
|
|
|
2014-09-19 16:38:37 -07:00
|
|
|
|
2014-09-28 16:29:11 -07:00
|
|
|
}
|