Compiles a piece of HTML or DOM into a scope
object.
var scope1 = angular.compile(window.document); scope1.$init(); var scope2 = angular.compile('click me'); 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.