angular_analyzer_plugin icon indicating copy to clipboard operation
angular_analyzer_plugin copied to clipboard

Small issue we could warn about: binding to content attributes when there's content already

Open MichaelRFairhurst opened this issue 8 years ago • 3 comments

See this SO post: http://stackoverflow.com/questions/38992712/angular2-dart-component-template-not-loading

basically <x [innerText]="y">z</x> should report a conflict between z and y.

same for innerHtml, which I think is used more often than innerText. And maybe a few other attributes.

MichaelRFairhurst avatar Jan 20 '17 00:01 MichaelRFairhurst

Might cause quite some false warnings. I'd expect the static content to be the default value

<x [innerText]="y">Content is loading ...</x>

zoechi avatar Jan 20 '17 08:01 zoechi

Yeah, this is a tricky one. We'd almost want to suggest both things: "Hey, this is blank until change detectors fill it" and "hey, this content gets overwritten!"

MichaelRFairhurst avatar Jan 23 '17 23:01 MichaelRFairhurst

I guess using a default value won't work anyway. If y is null the content will be purged at first change detection run. So, I don't see any use for content in elements with [innerHTML] binding.

zoechi avatar Jan 24 '17 09:01 zoechi