can we create a custom directive set as an element with required parameters , so that if these params are not provided by who ever would like to use it... then the directive must not work ???
**JS:**
app.directive('customDirective', function() {
return {
restrict: 'E',
scope : {
data : "=data", ...
} ,
templateUrl: function(element, attr) {
// HTML file path
},
....
}
});
the case is now even if these params are not passed , the directive still works and injects the html in the view .
This is a generic question about directive not related to this specific case only .
You could add your own validation in the link function
I'm not sure if there's a more official way though