Skip to content

Commit c5ec087

Browse files
committed
fix(generate): fix style and template url references
Dynamic paths for components were incorrectly generating paths for templates and styles Fixes angular#340
1 parent 1819afe commit c5ec087

File tree

2 files changed

+6
-3
lines changed

2 files changed

+6
-3
lines changed

addon/ng2/blueprints/component/files/src/app/__path__/__name__/__name__.ts

+2-2
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,8 @@ import {Component} from 'angular2/core';
33

44
@Component({
55
selector: '<%= dasherizedModuleName %>',
6-
templateUrl: 'app/<%= dynamicPath %>/<%= dasherizedModuleName %>/<%= dasherizedModuleName %>.html',
7-
styleUrls: ['app/<%= dynamicPath %>/<%= dasherizedModuleName %>/<%= dasherizedModuleName %>.css'],
6+
templateUrl: 'app<%= dynamicPath %>/<%= dasherizedModuleName %>/<%= dasherizedModuleName %>.html',
7+
styleUrls: ['app<%= dynamicPath %>/<%= dasherizedModuleName %>/<%= dasherizedModuleName %>.css'],
88
providers: [],
99
directives: [],
1010
pipes: []

addon/ng2/blueprints/component/index.js

+4-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
var stringUtils = require('ember-cli/lib/utilities/string');
22
var dynamicPathParser = require('../../utilities/dynamic-path-parser');
3+
var path = require('path');
34

45
module.exports = {
56
description: '',
@@ -13,7 +14,9 @@ module.exports = {
1314

1415
locals: function(options) {
1516
return {
16-
dynamicPath: this.dynamicPath.dir
17+
dynamicPath: this.dynamicPath.dir === path.sep
18+
? ''
19+
: this.dynamicPath.dir
1720
};
1821
},
1922

0 commit comments

Comments
 (0)