ajay dixit
ajay dixit

Reputation: 117

Set Default color value to angularjs color picker

I am trying to set default color value to my directive my div is

<div class="field">
   <color-picker ng-model="config.primaryColor"  options="options"></color-picker>
 </div>

Upvotes: 0

Views: 983

Answers (2)

Nitheesh
Nitheesh

Reputation: 19986

just put

$scope.config = {};

$scope.config.primaryColor = '#FF0000';

this will work I think

Upvotes: 1

abdoutelb
abdoutelb

Reputation: 1053

I think you should define $scope.config={} first then add to it the primary color

Upvotes: 1

Related Questions