Last active
August 29, 2015 14:04
-
-
Save karlwestin/51ea39c88d48da6c5500 to your computer and use it in GitHub Desktop.
how to use the angular compiler to compile a template outside of an angular app
This file contains 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
var app = angular.bootstrap(document.createElement("div"), ["my-module", "ng"]) | |
var $compile = app.get("$compile") | |
var compiled = $compile(myTmplString); | |
/* | |
compiled is a function, publicLinkFn, that is 2 steps away from seeing how any nodes look | |
nodes are accessed in a childNodes list, that can only be accessed by the compositeLinkFn | |
there's no access to a tree of the parsed template on the publicLinkFn | |
*/ |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment