MCPcopy Create free account
hub / github.com/angular-ui/ui-router / getNgAttribute

Function getNgAttribute

test/angular/1.3/angular.js:1206–1216  ·  view source on GitHub ↗
(element, ngAttr)

Source from the content-addressed store, hash-verified

1204var ngAttrPrefixes = ['ng-', 'data-ng-', 'ng:', 'x-ng-'];
1205
1206function getNgAttribute(element, ngAttr) {
1207 var attr, i, ii = ngAttrPrefixes.length;
1208 element = jqLite(element);
1209 for (i = 0; i < ii; ++i) {
1210 attr = ngAttrPrefixes[i] + ngAttr;
1211 if (isString(attr = element.attr(attr))) {
1212 return attr;
1213 }
1214 }
1215 return null;
1216}
1217
1218/**
1219 * @ngdoc directive

Callers 1

angularInitFunction · 0.70

Calls 1

isStringFunction · 0.70

Tested by

no test coverage detected