Created
July 15, 2013 19:23
-
-
Save perrygovier/6002644 to your computer and use it in GitHub Desktop.
directive to avoid console errors when evaluating attribute expressions in an ng-include such as src={{myval}}
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
directive('setattr', function() { | |
return function(scope, elem, attr){ | |
$(elem).attr(attr.setattr,attr.setattrval); | |
} | |
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<img setattr="src" setattrval="{{img}}" /> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment