Reputation: 63
I've just started with Angular and would like to know if there are any restrictions on the default angular directives. If not, can we override default angular directives and put some restrictions?
I need to create an app and I don't want anyone to invoke directives using "class", "comments" or "element". Can I apply this restriction in my angular apps.
Upvotes: 0
Views: 47
Reputation: 185
I don't think there are some existing flags or options that you can use to do put such restriction on built-in angular directives.
If there are such options, it should be on $compileProvider
. But I think you may try to decorate the directives to put such restriction, see Decorate Directives example in augularjs documents. Even this decorator method works, to get what you want, you need to decorate each of them.
Upvotes: 1
Reputation: 4840
When you define the configuration for a directive, you can specify restrict: 'A'
to enforce your particular directive to be only processed as an attribute.
Upvotes: 0