jw-ng-forward
Version:
Temporary package. The default solution for those that want to write Angular 2.x style code in Angular 1.x
23 lines (22 loc) • 679 B
JavaScript
;
Object.defineProperty(exports, "__esModule", { value: true });
function default_1(props) {
var map = {};
for (var i = 0; i < props.length; i++) {
var split = props[i].split(':');
for (var y = 0; y < split.length; y++) {
split[y] = split[y].trim();
}
if (split.length === 1) {
map[split[0]] = split[0];
}
else if (split.length === 2) {
map[split[0]] = split[1];
}
else {
throw new Error('Inputs and outputs must be in the form of "propName: attrName" or in the form of "attrName"');
}
}
return map;
}
exports.default = default_1;