-
Notifications
You must be signed in to change notification settings - Fork 27.1k
feat(compiler): detect dangling property bindings #2598
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -79,8 +79,8 @@ export function main() { | |
| '<template [ng-switch-when]="\'b\'"><li>when b1;</li></template>' + | ||
| '<template [ng-switch-when]="\'a\'"><li>when a2;</li></template>' + | ||
| '<template [ng-switch-when]="\'b\'"><li>when b2;</li></template>' + | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. we should be able to change this to: |
||
| '<template [ng-switch-default]><li>when default1;</li></template>' + | ||
| '<template [ng-switch-default]><li>when default2;</li></template>' + | ||
| '<template ng-switch-default><li>when default1;</li></template>' + | ||
| '<template ng-switch-default><li>when default2;</li></template>' + | ||
| '</ul></div>'; | ||
|
|
||
| tb.createView(TestComponent, {html: template}) | ||
|
|
@@ -108,7 +108,7 @@ export function main() { | |
| '<ul [ng-switch]="switchValue">' + | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. same here drop |
||
| '<template [ng-switch-when]="when1"><li>when 1;</li></template>' + | ||
| '<template [ng-switch-when]="when2"><li>when 2;</li></template>' + | ||
| '<template [ng-switch-default]><li>when default;</li></template>' + | ||
| '<template ng-switch-default><li>when default;</li></template>' + | ||
| '</ul></div>'; | ||
|
|
||
| tb.createView(TestComponent, {html: template}) | ||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -232,7 +232,7 @@ class CellData { | |
| </tbody> | ||
| <tbody template="ng-switch-when 'interpolationAttr'"> | ||
| <tr template="ng-for #row of data"> | ||
| <td template="ng-for #column of row" i="{{column.i}}" j="{{column.j}}"> | ||
| <td template="ng-for #column of row" attr.i="{{column.i}}" attr.j="{{column.j}}"> | ||
|
Member
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. @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. |
||
| i,j attrs | ||
| </td> | ||
| </tr> | ||
|
|
@@ -269,7 +269,7 @@ class LargetableComponent { | |
| @Component({selector: 'app'}) | ||
| @View({ | ||
| directives: [LargetableComponent], | ||
| template: `<largetable [data]='data' [benchmarkType]='benchmarkType'></largetable>` | ||
| template: `<largetable [data]='data' [benchmark-type]='benchmarkType'></largetable>` | ||
| }) | ||
| class AppComponent { | ||
| data; | ||
|
|
||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
having
[ng-for]with no expression should be an error:A property binding [ng-for] must have an expression associated with it.
Could we add a test?