Created
November 21, 2014 18:59
-
-
Save maxpeterson/49ea211445fdf3ae1be1 to your computer and use it in GitHub Desktop.
Angular factory for debugging IE8 by prepending `compiled` templates to the body
This file contains hidden or 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('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