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

Function splitClasses

test/angular/1.6/angular.js:5445–5461  ·  view source on GitHub ↗
(classes)

Source from the content-addressed store, hash-verified

5443}
5444
5445function splitClasses(classes) {
5446 if (isString(classes)) {
5447 classes = classes.split(' ');
5448 }
5449
5450 // Use createMap() to prevent class assumptions involving property names in
5451 // Object.prototype
5452 var obj = createMap();
5453 forEach(classes, function(klass) {
5454 // sometimes the split leaves empty string values
5455 // incase extra spaces were applied to the options
5456 if (klass.length) {
5457 obj[klass] = true;
5458 }
5459 });
5460 return obj;
5461}
5462
5463// if any other type of options value besides an Object value is
5464// 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