MCPcopy Create free account
hub / github.com/apache/cloudstack / startingTag

Function startingTag

tools/ngui/static/js/lib/angular.js:797–816  ·  view source on GitHub ↗

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

(element)

Source from the content-addressed store, hash-verified

795 * @returns {string} Returns the string representation of the element.
796 */
797function startingTag(element) {
798 element = jqLite(element).clone();
799 try {
800 // turns out IE does not let you set .html() on elements which
801 // are not allowed to have children. So we just ignore it.
802 element.html('');
803 } catch(e) {}
804 // As Per DOM Standards
805 var TEXT_NODE = 3;
806 var elemHtml = jqLite('<div>').append(element).html();
807 try {
808 return element[0].nodeType === TEXT_NODE ? lowercase(elemHtml) :
809 elemHtml.
810 match(/^(<[^>]+>)/)[1].
811 replace(/^<([\w\-]+)/, function(match, nodeName) { return '<' + lowercase(nodeName); });
812 } catch(e) {
813 return lowercase(elemHtml);
814 }
815
816}
817
818
819/////////////////////////////////////////////////

Callers 4

applyDirectivesToNodeFunction · 0.85
nodeLinkFnFunction · 0.85
assertNoDuplicateFunction · 0.85
angular.jsFile · 0.85

Calls 5

lowercaseFunction · 0.85
replaceMethod · 0.80
cloneMethod · 0.45
appendMethod · 0.45
matchMethod · 0.45

Tested by

no test coverage detected