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

Function splitClasses

test/angular/1.7/angular.js:5471–5487  ·  view source on GitHub ↗
(classes)

Source from the content-addressed store, hash-verified

5469}
5470
5471function splitClasses(classes) {
5472 if (isString(classes)) {
5473 classes = classes.split(' ');
5474 }
5475
5476 // Use createMap() to prevent class assumptions involving property names in
5477 // Object.prototype
5478 var obj = createMap();
5479 forEach(classes, function(klass) {
5480 // sometimes the split leaves empty string values
5481 // incase extra spaces were applied to the options
5482 if (klass.length) {
5483 obj[klass] = true;
5484 }
5485 });
5486 return obj;
5487}
5488
5489// if any other type of options value besides an Object value is
5490// passed into the $animate.method() animation then this helper code

Callers 1

handleCSSClassChangesFunction · 0.70

Calls 3

isStringFunction · 0.70
createMapFunction · 0.70
forEachFunction · 0.70

Tested by

no test coverage detected