Issue
I get this warning :
The specified value "" does not conform to the required format. The format is "#rrggbb" where rr, gg, bb are two-digit hexadecimal numbers.
Here's the code :
<input type="color" [formControl]="fcBackgroundColor">
where fcBackgroundColor is :
fcBackgroundColor = new FormControl('');
or
fcBackgroundColor = new FormControl();
It's just a warning, but what's the right way to initialize the input control?
Solution
As per MDN input type color value must always be a DOMString which contains a 7-character string specifying an RGB color in hexadecimal format. The value is never in any other form, or empty.
So its better you give a default value and process.
Answered By - Arun Mohan
0 comments:
Post a Comment
Note: Only a member of this blog may post a comment.