MCPcopy
hub / github.com/angular-ui/ui-router / getNgAttribute

Function getNgAttribute

test/angular/1.4/angular.js:1445–1454  ·  view source on GitHub ↗
(element, ngAttr)

Source from the content-addressed store, hash-verified

1443var ngAttrPrefixes = ['ng-', 'data-ng-', 'ng:', 'x-ng-'];
1444
1445function getNgAttribute(element, ngAttr) {
1446 var attr, i, ii = ngAttrPrefixes.length;
1447 for (i = 0; i < ii; ++i) {
1448 attr = ngAttrPrefixes[i] + ngAttr;
1449 if (isString(attr = element.getAttribute(attr))) {
1450 return attr;
1451 }
1452 }
1453 return null;
1454}
1455
1456/**
1457 * @ngdoc directive

Callers 1

angularInitFunction · 0.70

Calls 1

isStringFunction · 0.70

Tested by

no test coverage detected