Last active
November 16, 2017 05:27
-
-
Save usmansaleem/6926ad2ddc952b9d34050efa91e83048 to your computer and use it in GitHub Desktop.
Embedding gist with Angular 1
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
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