Compiles a piece of HTML or DOM into a scope
object.
var scope1 = angular.compile(window.document); scope1.$init(); var scope2 = angular.compile('<div ng:click="clicked = true">click me</div>'); scope2.$init();
angular.compile(element[, parentScope]);
element – {string|DOMElement} –
Element to compile.
parentScope(optional) – {Object} –
Scope to become the parent scope of the newly compiled scope.
{Object}
– Compiled scope object.