Skip to content

Instantly share code, notes, and snippets.

@BBB
Created January 9, 2015 14:06
Show Gist options
  • Save BBB/5a5cc0d2ea82124aec75 to your computer and use it in GitHub Desktop.
Save BBB/5a5cc0d2ea82124aec75 to your computer and use it in GitHub Desktop.
$http.get( tpl, { cache: $templateCache } )
.then( function( response ) {
templateScope = scope.$new();
templateCtrl = $controller( ctrl, { $scope: templateScope } );
element.html( response.data );
element.children().data('$ngControllerController', templateCtrl);
$compile( element.contents() )( templateScope );
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment