Pages

Friday 2 December 2016

component relative paths instead of absolute path in angular 2

                                                                         So guys if you're using quickstart repo of angular 2 instead of ng-cli then many things you have to do yourself one of them is relative path of component html and stylesheets and you can do this simply by using moduleId in component like in the example shown below

1
2
3
4
5
@Component({
  moduleId: module.id,
  selector: 'user-app',
  templateUrl: 'user.component.html'
})

This will make the relative path work. I also added this solution as a stackoverflow answer. feel free to upvote.

No comments:

Post a Comment