Hi Namila,
angular.element('.date-picker') will apply your code to all date-pickers in
your page. The nett effect in most cases will be that all ngModels will get
set to the latest one you added to the page.
in your case you better use something like:
link: function (scope, element, attrs, ngModelCtrl) {
element.find('input').datepicker().on('changeDate', function (e) {
ngModelCtrl.$setViewValue(e.date);
scope.$apply();
});
}
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 https://groups.google.com/group/angular.
For more options, visit https://groups.google.com/d/optout.