MCPcopy Create free account
hub / github.com/EricSimons/ionic-course / getNgAttribute

Function getNgAttribute

code/songhop/www/lib/angular/angular.js:1189–1199  ·  view source on GitHub ↗
(element, ngAttr)

Source from the content-addressed store, hash-verified

1187var ngAttrPrefixes = ['ng-', 'data-ng-', 'ng:', 'x-ng-'];
1188
1189function getNgAttribute(element, ngAttr) {
1190 var attr, i, ii = ngAttrPrefixes.length;
1191 element = jqLite(element);
1192 for (i = 0; i < ii; ++i) {
1193 attr = ngAttrPrefixes[i] + ngAttr;
1194 if (isString(attr = element.attr(attr))) {
1195 return attr;
1196 }
1197 }
1198 return null;
1199}
1200
1201/**
1202 * @ngdoc directive

Callers 1

angularInitFunction · 0.70

Calls 1

isStringFunction · 0.70

Tested by

no test coverage detected