feat(compiler): detect dangling property bindings#2598
Conversation
|
This is part of #2014 that takes only run-time generated schema into account. Opening this one asap to validate the approach (collecting property bindings and directive bindings in compile steps - we do it anyway - and do verifications in the |
58b91e5 to
01ffa28
Compare
There was a problem hiding this comment.
@tbosch I hope that this doesn't change the nature of this test too much - I had to modify this one as we don't support binding to non-existing properties after this change.
|
@mhevery this is first step of full schema support that detects bindings to non-existing properties. It would be great if this one could be reviewed / approach validated so I can move on. |
01ffa28 to
72d3a53
Compare
There was a problem hiding this comment.
Do we need this extra information? The ProtoViewBuilder has all binding information of the element and all of it's directives already...
There was a problem hiding this comment.
@tbosch I believe that we need it due to the properties re-mapping. When we bind to directives we know only about property name on the directive side, but not about the original property binding.
72d3a53 to
7d30007
Compare
|
@tbosch I've rebased it, PTAL |
b1a53ba to
69cbb0f
Compare
There was a problem hiding this comment.
change error to include:
Can't bind to 'unknown' since it isn't a know property of the 'div' element, and there are no directives present which can accept that value.
Or something like that.
69cbb0f to
0b61210
Compare
BREAKING CHANGE: compiler will throw on binding to non-existing properties. Till now it was possible to have a binding to a non-existing property, ex.: `<div [foo]="exp">`. From now on this is compilation error - any property binding needs to have at least one associated property: eaither on an HTML element or on any directive associated with a given element (directives' properites need to be declared using the `properties` field in the `@Directive` / `@Component` annotation). Closes angular#2598
0b61210 to
d7b9345
Compare
|
This issue has been automatically locked due to inactivity. Read more about our automatic conversation locking policy. This action has been performed automatically by a bot. |
BREAKING CHANGE: compiler will throw on binding to non-existing properties.
Till now it was possible to have a binding to a non-existing property,
ex.:
<div [foo]="exp">. From now on this is compilation error - anyproperty binding needs to have at least one associated property:
eaither on an HTML element or on any directive associated with a
given element (directives' properites need to be declared using the
propertiesfield in the@Directive/@Componentannotation).