SO 29179415
HTML
<div ng-app="project">
<div ng-controller="ListCtrl" >
<div>
<input type="date" ng-model="startDate" /> <br/>
<input type="date" ng-model="endDate" my-directive="startDate"/>
</div>
<div>
{{startDate | json}}
</div>
</div>
</div>
CSS
</style> <!-- Ugly Hack due to jsFiddle issue: http://goo.gl/BUfGZ -->
<link rel="stylesheet" href="http://netdna.bootstrapcdn.com/bootstrap/3.0.3/css/bootstrap.min.css">
<script src="https://ajax.googleapis.com/ajax/libs/angularjs/1.3.14/angular.min.js"></script>
<style>
JavaScript
angular.module('project', [])
.controller('ListCtrl', function($scope) {
})
.directive("myDirective", function(){
return {
require: 'ngModel',
scope: {
minValue: "=myDirective"
},
link: function(scope, element, attrs) {
//scope.$apply(function () {
debugger
attrs.$set('min', '2015-03-21');
//});
}
}
});