Search code examples
datetimepickerangular-material

ng-click, ng-change not working in angular material datetimepicker


Hi all I'm using http://logbon72.github.io/angular-material-datetimepicker/ for angular material datetimepicker, It looks cool and great but problem is I can't able to perform ng-click and ng-change for validation purpose. Can anyone help me.


Solution

  • It looks like ng-change and ng-click are not available for these directives. The way to achieve the equivalent of ng-change is to use $scope.$watch - Plunker

    JS

    $scope.$watch("vm.employee.dateOfBirth", function (newValue) {
        console.log(newValue);
    });