I'm a beginner with Angular and I'm trying to pass some data to my angular directive from the template.
<div class="col-md-6" approver-picker="partner.approverPlan.data" data-pickerType="PLAN"></div>
I have this in multiple places in my angular template and I need to know which picker is being clicked in my Angular code.
I am considering reading the value of data-pickerType
in my directive. (I can do this in jQuery but not sure how in Angular)
This is what my directive code looks like:
Partner.Editor.App.directive('approverPicker', [
'$compile', function ($compile) {
return {
scope: {
"approvers": "=approverPicker"
},
templateUrl: '/template/assets/directive/ApproverPicker.html',
restrict: 'EA',
link: function ($scope, element) {
...........
}
};
}
]);
Any suggestions on how to read the data-pickerType
value in the directive or perhaps a better approach to achieve this?