MCPcopy Create free account
hub / github.com/bclinkinbeard/angular / startingTag

Function startingTag

test/fixtures/foo.js:1159–1178  ·  view source on GitHub ↗

* @returns {string} Returns the string representation of the element.

(element)

Source from the content-addressed store, hash-verified

1157 * @returns {string} Returns the string representation of the element.
1158 */
1159function startingTag(element) {
1160 element = jqLite(element).clone();
1161 try {
1162 // turns out IE does not let you set .html() on elements which
1163 // are not allowed to have children. So we just ignore it.
1164 element.empty();
1165 } catch(e) {}
1166 // As Per DOM Standards
1167 var TEXT_NODE = 3;
1168 var elemHtml = jqLite('<div>').append(element).html();
1169 try {
1170 return element[0].nodeType === TEXT_NODE ? lowercase(elemHtml) :
1171 elemHtml.
1172 match(/^(<[^>]+>)/)[1].
1173 replace(/^<([\w\-]+)/, function(match, nodeName) { return '<' + lowercase(nodeName); });
1174 } catch(e) {
1175 return lowercase(elemHtml);
1176 }
1177
1178}
1179
1180
1181/////////////////////////////////////////////////

Callers 8

doBootstrapFunction · 0.85
applyDirectivesToNodeFunction · 0.85
nodeLinkFnFunction · 0.85
assertNoDuplicateFunction · 0.85
textInputTypeFunction · 0.85
foo.jsFile · 0.85
setupAsOptionsFunction · 0.85

Calls 1

lowercaseFunction · 0.85

Tested by

no test coverage detected