Created
July 11, 2014 13:25
-
-
Save craigjbass/20e98b1fd72cff69c957 to your computer and use it in GitHub Desktop.
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.)
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
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); | |
} ); | |
}, | |
terminal: true | |
} | |
}] ); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment