Hi Andy,
it seems that ngModel and input[type=color] don't like each other. I
suspect some browser issues.
But is is easily avoided by creating your own color directive. I made this
crude first draft for you:
```
function myColor($parse) {
var ddo = {
restrict:'A',
link:link
};
return ddo;
function link(scope,elm,attr) {
var parser = $parse(attr.myColor);
var getColor = function () {return parser(scope); };
var setColor = function (x) {return parser.assign(scope,x); };
scope.$watch(attr.myColor,function (color) {
elm[0].value = getColor();
});
elm[0].addEventListener('change',function () {
scope.$apply(function () {
setColor(elm[0].value);
});
});
}
}
```
It works but clearly needs some polishing. you can see it in action in this
plunk <http://plnkr.co/edit/22r4mQXQO8Sq333H60oZ?p=preview>.
Regards
Sander
--
You received this message because you are subscribed to the Google Groups
"AngularJS" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
To post to this group, send email to [email protected].
Visit this group at http://groups.google.com/group/angular.
For more options, visit https://groups.google.com/d/optout.