groupe-sii / generator-webpack-angular

Yeoman generator for building Single Page Apps with AngularJS, ES6 and Webpack
MIT License
12 stars 3 forks source link

Failed to load template using UI-Router #7

Open psujit opened 7 years ago

psujit commented 7 years ago

Hello, I am using this generator for my application and I am adding multiple states inside the app.routes.js. I am using templateUrl to provide the path of the partial/view file. But the application fails to load the HTML partial/view file(newpage.html) which is situated in app/views/ folder. I tried all options for relative paths in app.routes.js. What can be done in order that templateUrl works perfectly? The exact error I am getting is this: Error: [$compile:tpload] Failed to load template: /src/app/views/newpage.html (HTTP status: 404 Not Found) Please let me know what path has to be used to correctly access the partial/view.

psujit commented 7 years ago

I found a work around: Instead of using templateUrl, use template with require method. For e.g.: template: require('../views/newpage.html'),

Although this works, I would still like to know what is the issue with using templateUrl.