Skip to content

Instantly share code, notes, and snippets.

@perrygovier
Created July 15, 2013 19:23
Show Gist options
  • Save perrygovier/6002644 to your computer and use it in GitHub Desktop.
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}}
directive('setattr', function() {
return function(scope, elem, attr){
$(elem).attr(attr.setattr,attr.setattrval);
}
});
<img setattr="src" setattrval="{{img}}" />
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment