作者:Hongbo-Mia
项目:angular2-meteor-universa
get(templateUrl: string): Promise<string> {
const completer: PromiseCompleter<string> = PromiseWrapper.completer();
const fullPath = path.join(this.assetsPath, templateUrl);
this.ngZone.run(() => {
fs.readFile(fullPath, (err, data) => {
if (err) {
return completer.reject(`Failed to load ${templateUrl} with error ${err}`);
}
this.ngZone.run(() => {
completer.resolve(data.toString());
});
});
});
return completer.promise;
}
作者:Shawn999
项目:angular2-moda
constructor(public context?: T) {
this._resultDeferred = PromiseWrapper.completer();
}
作者:andela-jmwang
项目:angular2-moda
constructor(public config: ModalConfig) {
this._resultDeferred = PromiseWrapper.completer();
}