Skip to content

Commit 090b95d

Browse files
committed
bug(generate): align directive selector with the style guide
Fixes #1706
1 parent 5ac060b commit 090b95d

File tree

1 file changed

+12
-2
lines changed

1 file changed

+12
-2
lines changed

addon/ng2/blueprints/directive/index.js

Lines changed: 12 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,14 +7,24 @@ module.exports = {
77
description: '',
88

99
availableOptions: [
10-
{ name: 'flat', type: Boolean, default: true }
10+
{ name: 'flat', type: Boolean, default: true },
11+
{ name: 'prefix', type: Boolean, default: true }
1112
],
1213

1314
normalizeEntityName: function (entityName) {
1415
var parsedPath = dynamicPathParser(this.project, entityName);
1516

1617
this.dynamicPath = parsedPath;
17-
this.rawEntityName = parsedPath.name;
18+
19+
var defaultPrefix = '';
20+
if (this.project.ngConfig &&
21+
this.project.ngConfig.apps[0] &&
22+
this.project.ngConfig.apps[0].prefix) {
23+
defaultPrefix = this.project.ngConfig.apps[0].prefix;
24+
}
25+
var prefix = this.options.prefix ? defaultPrefix : '';
26+
27+
this.rawEntityName = prefix + parsedPath.name;
1828
return parsedPath.name;
1929
},
2030

0 commit comments

Comments
 (0)