Skip to content

Instantly share code, notes, and snippets.

@maxpeterson
Created November 21, 2014 18:59
Show Gist options
  • Save maxpeterson/49ea211445fdf3ae1be1 to your computer and use it in GitHub Desktop.
Save maxpeterson/49ea211445fdf3ae1be1 to your computer and use it in GitHub Desktop.
Angular factory for debugging IE8 by prepending `compiled` templates to the body
angular.module('ie8debug').factory('prepend', [
'$rootScope',
'$compile',
function($rootScope, $compile) {
return function (template, context) {
var scope = $rootScope.$new(true);
angular.extend(scope, context);
angular.element(document).find('body').prepend(
$compile(template)(scope)
);
};
}
]);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment