I am having a custom datepicker and used two way data binding and want to
reset it's value from controller.
I have one clear function inside the directive's scope and want to call
this method from controller so that it's value gets reset to blank.
ds.directive('datePicker', function() {
return {
restrict: 'E',
scope: {
date: '='
},
templateUrl: 'js/directives/date-picker.html',
link: function(scope, elem, attrs) {
scope.dt = null;
if (scope.date !== undefined && scope.date !== null) {
scope.dt = Dates.stringToDate(scope.date);
}
else{
scope.dt = null
}
scope.clear = function () {
scope.dt = null;
};
--
You received this message because you are subscribed to the Google Groups
"Angular and AngularJS discussion" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
To view this discussion on the web visit
https://groups.google.com/d/msgid/angular/63837f7e-048e-46a3-a311-a5bdccc5bf68%40googlegroups.com.