What I want to do is to create an element directive, that can have bindable attributes and can work with static values.
Ex. I have a directive myTag which should support enablel/disable of some features... I want this to work like
<my-tag enable_f1="true" enable_f2="true" />
or like
<my-tag enable_f1="{{mc.someVal1}}" enable_f2="{{mc.someVal2}}" />
Now how can I write link method, to support binding to the attributes as well as static values?
angular.module('TestModule',[])
.directive('myTag',function() {
return {
restrict: 'E',
templateUrl: '<div></div>',
link: function (scope, element, attrs){
//I can get attrs.enable_f1, attrs.enable_f2, but what if it is bound to model?
}
}
});