-
-
Save localpcguy/c70cbd78b40fa34310acf8ceb0718759 to your computer and use it in GitHub Desktop.
Ember Templates
This file contains hidden or 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
//<p class="name">hi {{name}}</p> | |
Handlebars.templates["hi"]=function(data) { | |
return "<p class=\"name\">hi " | |
+ escapeExpression(data['name']) | |
+ "</p>\n"; | |
}); |
This file contains hidden or 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
//<p class="name">hi {{name}}</p> | |
(function() { | |
return { | |
meta: {}, | |
isEmpty: false, | |
arity: 0, | |
cachedFragment: null, | |
hasRendered: false, | |
buildFragment: function buildFragment(dom) { | |
var el0 = dom.createDocumentFragment(); | |
var el1 = dom.createElement("p"); | |
dom.setAttribute(el1,"class","name"); | |
var el2 = dom.createTextNode("hi "); | |
dom.appendChild(el1, el2); | |
var el2 = dom.createComment(""); | |
dom.appendChild(el1, el2); | |
dom.appendChild(el0, el1); | |
return el0; | |
}, | |
buildRenderNodes: function buildRenderNodes(dom, fragment, contextualElement) { | |
var morphs = new Array(1); | |
morphs[0] = dom.createMorphAt(dom.childAt(fragment, [0]),1,1); | |
return morphs; | |
}, | |
statements: [ | |
["content","name",["loc",[null,[1,19],[1,27]]],0,0,0,0] | |
], | |
locals: [], | |
templates: [] | |
}; | |
}()) |
This file contains hidden or 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
//<p class="name">hi {{name}}</p> | |
["open-element","p",[]] | |
["static-attr","class","name"] | |
["flush-element"] | |
["text","hi "] | |
["append",["unknown",["name"]],false] | |
["close-element"] |
This file contains hidden or 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
//<div><span>{{hello world}}</span></div> | |
[ | |
[11,"div"],[11, "span"], | |
[1, [33, ["hello"], [28, "world"]]] | |
[14], [14] | |
] | |
// 1: append | |
// 11: open-element | |
// 14: close-element | |
// 28: lookup | |
// 33: helper |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment