angular.compile
Description
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();
Usage
angular.compile(element, parentScope);
Parameters
- element –
{string|DOMElement}
– Element to compile.
- parentScope –
{Object=}
– Scope to become the parent scope of the newly compiled scope.
Returns
{Object} Compiled scope object.