Skip to content

Instantly share code, notes, and snippets.

@usmansaleem
Last active November 16, 2017 05:27
Show Gist options
  • Save usmansaleem/6926ad2ddc952b9d34050efa91e83048 to your computer and use it in GitHub Desktop.
Save usmansaleem/6926ad2ddc952b9d34050efa91e83048 to your computer and use it in GitHub Desktop.
Embedding gist with Angular 1
blogApp.directive('gistDirective', function() {
return function(scope, element, attrs) {
scope.$watch('blogItem', function(){
angular.element('[data-gist-id]').gist();
});
}
});
//then
<section gist-directive>
<article>
<div ng-bind-html="trustBlogHtml(blogItem.body)"></div>
</article>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment