MCPcopy Create free account
hub / github.com/cafebazaar/blacksmith / startingTag

Function startingTag

web/static/bower_components/angular/angular.js:1280–1297  ·  view source on GitHub ↗

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

(element)

Source from the content-addressed store, hash-verified

1278 * @returns {string} Returns the string representation of the element.
1279 */
1280function startingTag(element) {
1281 element = jqLite(element).clone();
1282 try {
1283 // turns out IE does not let you set .html() on elements which
1284 // are not allowed to have children. So we just ignore it.
1285 element.empty();
1286 } catch (e) {}
1287 var elemHtml = jqLite('<div>').append(element).html();
1288 try {
1289 return element[0].nodeType === NODE_TYPE_TEXT ? lowercase(elemHtml) :
1290 elemHtml.
1291 match(/^(<[^>]+>)/)[1].
1292 replace(/^<([\w\-]+)/, function(match, nodeName) { return '<' + lowercase(nodeName); });
1293 } catch (e) {
1294 return lowercase(elemHtml);
1295 }
1296
1297}
1298
1299
1300/////////////////////////////////////////////////

Callers 8

doBootstrapFunction · 0.85
applyDirectivesToNodeFunction · 0.85
assertNoDuplicateFunction · 0.85
invokeLinkFnFunction · 0.85
angular.jsFile · 0.85
parseOptionsExpressionFunction · 0.85
patternDirectiveFunction · 0.85

Calls 1

lowercaseFunction · 0.85

Tested by

no test coverage detected