Skip to content

Instantly share code, notes, and snippets.

View craigjbass's full-sized avatar
😁

Craig J. Bass craigjbass

😁
View GitHub Profile
@craigjbass
craigjbass / ng-angular-element
Created July 11, 2014 13:25
Implements the converse to ng-non-bindable: "ng-bindable" (only compiles mark up within <angular> tags, this is useful for legacy applications which cannot have {'s and }'s escaped easily.)
angular.module( 'ng-angular-element', [] )
.directive( 'angular', function() { return { restrict: 'E' }; } )
.directive( 'html', ['$compile', '$rootScope', '$document',
function( $compile, $rootScope, $document ) {
return {
restrict: 'E',
compile: function(scope, element, attributes) {
angular.forEach( $document.find( 'angular' ), function( angularElement ) {
$compile(angularElement)($rootScope);
} );