I am looking to create a custom hello
directive that can be utilized in the following manner:
<hello foo="bar"></hello>
When the foo
attribute is set to "bar", I want to substitute the element with
<div ng-show="true"></div>"
; if not, replace it with <div ng-show="false"></div>"
. However, only the hello
element should be replaced, not any of its nested children!
For instance:
<hello foo="bar">
<h1>Hi everyone!</h1>
</hello>
Should result in:
<div ng-show="true">
<h1>Hi everyone!</h1>
</div>
Do you think this can be achieved?