Closed fidoboy closed 9 years ago
I'm not familiar with ngValue directive. You should probably use ngModel.
As stated in the documentation of ngValue
, this directive should be used with input[type="radio"]
or option
elements. ngModel should be sufficient for input[type="date"]
. However, I would recommend to switch to the AngularJS 1.3.x
which doesn't require this polyfill. Please let me know, if you have further questions.
Thanks @slavafomin for answering so fast :) Unfortunately i can't upgrade to 1.3 already and i'm using 1.2.26. Finally i've solved it using hg-model and ng-init in parent DOM element to define the starting value. ngValue doesn't seems to work; well, it works, cause value attribute is being filled and displayed but the directive doesn't seems to be using it.
No problem ;) By the way, why can't you set initial value in the controller in JavaScript?
Because my data is coming from remote server
You can apply data as soon as it loaded to the underlying model in the controller or even better you can inject this data to the controller using resolve
(if you are using ng-route
). I'm doing this all the time and it works perfectly.
I'm closing this issue for now. If you have any further questions feel free to ask them. Cheers!
ng-value="field.date" doesn't work. How can i set the value for this input?