I have used a datepicker directive in my code. My idea is, when a date is selected from the datepicker, the selected date must be printed on the screen.
Any suggested code regarding this issue? This was the code :
<script language="javascript">
angular
.module('myapp', ['ngMaterial','ngMessages'])
.controller('dateController', dateController);
function dateController ($scope) {
$scope.myDate = new Date();
}
</script>
</head>
<body ng-app="myapp">
<div class="datepickerdemo" ng-controller="dateController as ctrl" layout="column" ng-cloak>
<md-content>
<h4>Standard Date Picker</h4>
<md-datepicker
ng-model="myDate"
md-placeholder="Enter Date" ></md-datepicker>
</md-content>
</div>
</body>
</html>
And my doubt is how can get selected date when it is changed