1

I have created SPFx webpart with angular2 and implemented routing and navigation but facing issue as below image:

Error:

enter image description here

1. WebPart structure:

enter image description here

2. app-routing.module.ts file

enter image description here

3.app.module.ts file

enter image description here

  • Check this. Let me know if it helps. – Ganesh Sanap Sep 3 '19 at 6:09
  • I have already refereed this link but not working – Chandani Prajapati Sep 3 '19 at 6:10
  • Please check if you have passed the correct relative URL for dashboard.component.html in templateUrl. – Ganesh Sanap Sep 3 '19 at 6:14
  • I have passed templateUrl: './dashboard.component.html' – Chandani Prajapati Sep 3 '19 at 6:16
  • Try passing complete absolute URL or ./dashboard/dashboard.component.html – Ganesh Sanap Sep 3 '19 at 6:18
0

In Component.ts file have to change template url like this

enter image description here

Instead of,

enter image description here

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.