use Promise instead of Future

This commit is contained in:
vsavkin
2014-10-10 15:44:56 -04:00
parent f524a89cb6
commit 1a7d5160f2
14 changed files with 97 additions and 82 deletions

View File

@ -1,5 +1,5 @@
import {Type} from 'facade/lang';
import {Future} from 'facade/async';
import {Promise} from 'facade/async';
import {Element} from 'facade/dom';
//import {ProtoView} from './view';
import {TemplateLoader} from './template_loader';
@ -13,14 +13,14 @@ export class Compiler {
}
/**
* # Why future?
* # Why promise?
* - compilation will load templates. Instantiating views before templates are loaded will
* 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
*/
compile(component:Type, element:Element/* = null*/):Future/*<ProtoView>*/ {
compile(component:Type, element:Element/* = null*/):Promise/*<ProtoView>*/ {
return null;
}

View File

@ -1,11 +1,11 @@
import {Future} from 'facade/async';
import {Promise} from 'facade/async';
//import {Document} from 'facade/dom';
export class TemplateLoader {
constructor() {}
load(url:String):Future/*<Document>*/ {
load(url:String):Promise/*<Document>*/ {
return null;
}
}