Catch doubly defined inputs & outputs
For example
<div [innerHtml]="blah" [innerHtml]="blah"></div>
and
<div (click)="blah" (click)="blah"></div>
and even
<input [(ngModel)]="blah" [ngModel]="blah" (ngModelChange)="blah" />
All should be errors. Probably best to highlight both as errors though we could highlight just the second one
I assume this is only if the expression (blah) is also exactly the same?
Ah yes... (click)="x" (click)="y" is the same as (click)="x; y" which
is totally valid, so this is a stylistic choice not an error. Granted, I'm
not sure if the order of the former is deterministic and it may therefore
be a code smell.
But even then, a great example is [(ngModel)]="x" (ngModelChange)="y"
which also might not have a deterministic order but is absolutely
reasonable; you want to have a two way binding and two listen to it
(perhaps because you have a chain of two way bindings). Granted, desugaring
the ngModel is possible and leads to a deterministic order.
Of course for inputs the restriction still applies.
@matanlurey any thoughts on the deterministic ordering of repeated event tags?
On Dec 30, 2016 3:20 AM, "Günter Zöchbauer" [email protected] wrote:
I assume this is only if the expression (blah) is also exactly the same?
— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/dart-lang/angular_analyzer_plugin/issues/194#issuecomment-269760620, or mute the thread https://github.com/notifications/unsubscribe-auth/ABjWe0o0j7BAyNPElJG1Iv7IDDDeXGy8ks5rNOjygaJpZM4LXx12 .
I saw it mentionen in TS GitHub issues several times that order of event handlers is explicitely not defined. Curious whether this is the same in Dart.
This is currently caught because its an html parse error. Still, I'll leave this in, because we will soon be switching to a parser which may not catch this.