ericmdantas / generator-ng-fullstack

Client, server or fullstack - it's up to you. ng-fullstack gives you the best of the latest.
MIT License
704 stars 103 forks source link

Creating a new Angular2 Component does not place the feature name in the path to css + template #127

Closed Tadimsky closed 8 years ago

Tadimsky commented 8 years ago

In this file: generator-ng-fullstack/component/templates/component.ts

@Component({ selector: '<%= name %>', templateUrl: 'client/dev/<%= name %>/templates/<%= name %>.html', styleUrls: ['client/dev/<%= name %>/styles/<%= name %>.css'] })

There is no reference to the feature name in the path for the templateUrl and the styleUrls.

It should probably be something like this:

@Component({ selector: '<%= name %>', templateUrl: 'client/dev/<%= feature_name %>/<%= name %>/templates/<%= name %>.html', styleUrls: ['client/dev/<%= feature_name %>/<%= name %>/styles/<%= name %>.css'] })

Where feature_name is your variable for the feature name :)

ericmdantas commented 8 years ago

Nice catch, I'm on it.

It'll be:

@Component({
  selector: '__NAME__',
  templateUrl: 'client/dev/__FEATURE__/templates/__NAME__.html',
  styleUrls: ['client/dev/__FEATURE__/styles/__NAME__.css']
})
ericmdantas commented 8 years ago

Released 1.7.16.

Tadimsky commented 8 years ago

Awesome, thanks Eric!

ericmdantas commented 8 years ago

Thanks for reporting it :smile: