Skip to content

Instantly share code, notes, and snippets.

@alle
Created December 6, 2013 09:14
Show Gist options
  • Save alle/7820845 to your computer and use it in GitHub Desktop.
Save alle/7820845 to your computer and use it in GitHub Desktop.
changing directive template with decorator (for ng-YouTubeAPI.js), like http://angular-tips.com/blog/2013/09/experiment-decorating-directives/
app.config(function($provide) {
$provide.decorator('ytPlaytoDirective', function($delegate) {
var directive = $delegate[0];
directive.template = '<h5>{{ title }}, {{ viewCount }}</h5>';
return $delegate;
});
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment