diff --git a/modules/angular2/src/core/compiler/compiler.js b/modules/angular2/src/core/compiler/compiler.js index 674c548a8c..d8a2eab95b 100644 --- a/modules/angular2/src/core/compiler/compiler.js +++ b/modules/angular2/src/core/compiler/compiler.js @@ -199,10 +199,10 @@ export class Compiler { var protoView = this._compile(ce.componentDirective.type); if (PromiseWrapper.isPromise(protoView)) { - ListWrapper.push(promises, protoView); - protoView.then(function (protoView) { - ce.inheritedElementBinder.nestedProtoView = protoView; - }); + ListWrapper.push( + promises, + protoView.then(function(pv) { ce.inheritedElementBinder.nestedProtoView = pv;}) + ); } else { ce.inheritedElementBinder.nestedProtoView = protoView; } diff --git a/modules/angular2/test/core/compiler/compiler_common_tests.js b/modules/angular2/test/core/compiler/compiler_common_tests.js index 37b042f9de..690ac250e8 100644 --- a/modules/angular2/test/core/compiler/compiler_common_tests.js +++ b/modules/angular2/test/core/compiler/compiler_common_tests.js @@ -229,19 +229,17 @@ export function runCompilerCommonTests() { createNestedComponentSpec('(error -> sync)', templateResolver, 'Failed to load the template for ParentComponent'); - // TODO(vicb): Check why errors this fails with Dart - // TODO(vicb): The Promise is rejected with the correct error but an exc is thrown before - //templateResolver = new FakeTemplateResolver(); - //templateResolver.setSync(ParentComponent); - //templateResolver.setError(NestedComponent); - //createNestedComponentSpec('(sync -> error)', templateResolver, - // 'Failed to load the template for NestedComponent -> Failed to compile ParentComponent'); - // - //templateResolver = new FakeTemplateResolver(); - //templateResolver.setAsync(ParentComponent); - //templateResolver.setError(NestedComponent); - //createNestedComponentSpec('(async -> error)', templateResolver, - // 'Failed to load the template for NestedComponent -> Failed to compile ParentComponent'); + templateResolver = new FakeTemplateResolver(); + templateResolver.setSync(ParentComponent); + templateResolver.setError(NestedComponent); + createNestedComponentSpec('(sync -> error)', templateResolver, + 'Failed to load the template for NestedComponent -> Failed to compile ParentComponent'); + + templateResolver = new FakeTemplateResolver(); + templateResolver.setAsync(ParentComponent); + templateResolver.setError(NestedComponent); + createNestedComponentSpec('(async -> error)', templateResolver, + 'Failed to load the template for NestedComponent -> Failed to compile ParentComponent'); });