How do I make the following code append 2 to the document?
var $injector = angular.injector(['ng']);
$injector.invoke(function ($compile, $rootScope) {
var link = $compile('<p>{{1+1}}</p>');
var newElement = link($rootScope);
$(document.body).append(newElement);
});
What I now see in browser is
{{1+1}}
EDIT
I want the added to body element, not just be interpolated static HTML, but to be an angular app - so that it reflects changes in scope, has event handlers, etc.