Skip to content

Commit 3726abf

Browse files
hanslfilipesilva
authored andcommitted
fix(@angular/cli): do not limit arguments of schematics
The schema of a Schematic can be any valid schema. The CLI was erroring if it included anything else than strings or booleans.
1 parent 1cb8818 commit 3726abf

File tree

1 file changed

+10
-1
lines changed

1 file changed

+10
-1
lines changed

packages/@angular/cli/tasks/schematic-get-options.ts

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,14 @@ export default Task.extend({
3737
case 'boolean':
3838
type = Boolean;
3939
break;
40+
case 'integer':
41+
case 'number':
42+
type = Number;
43+
break;
44+
45+
// Ignore arrays / objects.
46+
default:
47+
return null;
4048
}
4149
let aliases: string[] = [];
4250
if (opt.alias) {
@@ -52,7 +60,8 @@ export default Task.extend({
5260
type,
5361
default: undefined // do not carry over schematics defaults
5462
};
55-
});
63+
})
64+
.filter(x => x);
5665

5766
return Promise.resolve(availableOptions);
5867
}

0 commit comments

Comments
 (0)