From b7855035430444880cf8a2ce55977cbf3fddd987 Mon Sep 17 00:00:00 2001 From: Pawel Kozlowski Date: Wed, 15 Jul 2015 14:52:41 +0200 Subject: [PATCH] refactor(ProtoViewBuilder): improve error message for dangling bindings Closes #3066 --- modules/angular2/src/render/dom/view/proto_view_builder.ts | 2 +- modules/angular2/test/core/compiler/integration_spec.ts | 2 +- .../angular2/test/render/dom/view/proto_view_builder_spec.ts | 4 ++-- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/modules/angular2/src/render/dom/view/proto_view_builder.ts b/modules/angular2/src/render/dom/view/proto_view_builder.ts index 49169c16d6..65939eb92e 100644 --- a/modules/angular2/src/render/dom/view/proto_view_builder.ts +++ b/modules/angular2/src/render/dom/view/proto_view_builder.ts @@ -322,7 +322,7 @@ function buildElementPropertyBindings(protoElement: /*element*/ any, isNgCompone propertyBindings.push(propertyBinding); } else if (!SetWrapper.has(directiveTempaltePropertyNames, propertyNameInTemplate)) { throw new BaseException( - `Can't bind to '${propertyNameInTemplate}' since it isn't a know property of the '${DOM.tagName(protoElement).toLowerCase()}' element and there are no matching directives with a corresponding property`); + `Can't bind to '${propertyNameInTemplate}' since it isn't a known property of the '<${DOM.tagName(protoElement).toLowerCase()}>' element and there are no matching directives with a corresponding property`); } }); return propertyBindings; diff --git a/modules/angular2/test/core/compiler/integration_spec.ts b/modules/angular2/test/core/compiler/integration_spec.ts index 2cb14f7cf9..3177d558c8 100644 --- a/modules/angular2/test/core/compiler/integration_spec.ts +++ b/modules/angular2/test/core/compiler/integration_spec.ts @@ -1283,7 +1283,7 @@ export function main() { PromiseWrapper.catchError(tcb.createAsync(MyComp), (e) => { expect(e.message).toEqual( - `Can't bind to 'unknown' since it isn't a know property of the 'div' element and there are no matching directives with a corresponding property`); + `Can't bind to 'unknown' since it isn't a known property of the '
' element and there are no matching directives with a corresponding property`); async.done(); return null; }); diff --git a/modules/angular2/test/render/dom/view/proto_view_builder_spec.ts b/modules/angular2/test/render/dom/view/proto_view_builder_spec.ts index 00efd3a4d7..f7311725c8 100644 --- a/modules/angular2/test/render/dom/view/proto_view_builder_spec.ts +++ b/modules/angular2/test/render/dom/view/proto_view_builder_spec.ts @@ -31,7 +31,7 @@ export function main() { builder.bindElement(el('
')).bindProperty('unknownProperty', emptyExpr()); expect(() => builder.build()) .toThrowError( - `Can't bind to 'unknownProperty' since it isn't a know property of the 'div' element and there are no matching directives with a corresponding property`); + `Can't bind to 'unknownProperty' since it isn't a known property of the '
' element and there are no matching directives with a corresponding property`); }); it('should allow unknown properties if a directive uses it', () => { @@ -53,7 +53,7 @@ export function main() { binder.setComponentId('someComponent'); expect(() => builder.build()) .toThrowError( - `Can't bind to 'unknownProperty' since it isn't a know property of the 'some-custom' element and there are no matching directives with a corresponding property`); + `Can't bind to 'unknownProperty' since it isn't a known property of the '' element and there are no matching directives with a corresponding property`); }); });