In an attempt to disable a field using an attribute without utilizing the directive scope property, I am seeking a way to disable my field with the type 'date'.
Check out my code snippet below:
http://plnkr.co/edit/eJDRocLYkr8Krh84vFKY?p=preview
var app = angular.module('plunker', []);
app.controller('MainCtrl', function($scope) {
$scope.name = 'World';
$scope.clickb=function(){
alert('dd')
$scope.disabletest=true;
}
});
app.directive('test',function(){
return {
restrict :'E',
scope:{},
template:'<input type="date" ng-disable="disabletest">',
link:function(s,e,a){
}
}
})
The value of the disable
attribute in the directive is used to disable the field upon button click.
My goal is to use the attribute property to disable the input field of type 'date' upon clicking a button.