1

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.

Stepan Suvorov
  • 23,436
  • 25
  • 100
  • 172

1 Answers1

1

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

Community
  • 1
  • 1
Günter Zöchbauer
  • 558,509
  • 191
  • 1,911
  • 1,506