AngularJS Bind Attribute Presence
- by Chuck
I want to bind the presence of an attribute to a variable in AngularJS. Specifically, sandbox for an iframe. Say I have $myCtrl.allowJavascript as a variable, I want to do:
<iframe src="..." sandbox />
Where the sandbox attribute is present when allowJavascript == false, and I want the sandbox attribute to disappear when allowJavascript == true.
Does AngularJS have a mechanism for this?
The closest thing I could find was here, which basically says "it will just work for certain attributes"--but not for sandbox.