And I bound m" /> And I bound m" /> And I bound m"/>

Who validates the property?

38 views Asked by At

I'm trying to find the piece of code that is responsible for property value validation.

For example I have:

<h1 [style.color]="myColor">

And I bound myColor variable with input:

<input (input)="myColor = $event.target.value">

I expect change of color on input change. But! Change happens only if I have valid color name in myColor otherwise it keeps an old value.

Plunker with example.

So my question is "How is responsible of property validation?" I quickly looked though the source code but did not find an answer.

1

There are 1 answers

0
Günter Zöchbauer On BEST ANSWER

The browser just ignores invalid values. There is no validation happening except sanitization which removes some security-sensitive values like urls In RC.1 some styles can't be added using binding syntax