MCPcopy Create free account
hub / github.com/binux/qiandao / startingTag

Function startingTag

web/static/components/angularjs/angular.js:1154–1173  ·  view source on GitHub ↗

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

(element)

Source from the content-addressed store, hash-verified

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

Callers 8

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

Calls 1

lowercaseFunction · 0.85

Tested by

no test coverage detected