Reputation: 651
I am wondering if the following is possible:
<directiveName parameter1=value1 parameter2=value2 ng-disabled="true"> </directiveName>
For some reason, it wasn't working for me and I wasn't able to find much examples of a use like this.
I can, however, toggle the visibility of the directive using this:
<directiveName parameter1=value1 parameter2=value2 ng-if="true"> </directiveName>
Why can't I seem to use ng-disabled
?
(The purpose of the directive is to make a connection with a topic and display the messages in the topic, so all it outputs is plain text.)
Upvotes: 0
Views: 54
Reputation: 7264
As per the documentation for ngDisabled:
This directive sets the disabled attribute on the element if the expression inside ngDisabled evaluates to truthy.
But in your case, it seems ngDisabled will be adding a disabled
attribute to an element that does nothing with it.
'disabled' only makes logical sense for elements that allow user input or interaction. Out of the box, it works for form inputs, anchor tags and buttons. If you require 'disabled' behaviour for other things then you need to provide it yourself.
Upvotes: 1