I recently used webpack to package the angular1. folder, can’t the path of templateUrl in my routing configuration be hard-coded directly?
//app.config.js
routing.$inject = ['$stateProvider', '$urlRouterProvider', '$locationProvider'];
export default function routing($stateProvider, $urlRouterProvider, $locationProvider){
$urlRouterProvider.otherwise('/home');
$stateProvider
.state('home', {
url: '/home',
templateUrl: 'views/home.html',
controller: 'HomeController'
})
};
2. There are many img srcs in the page, but the paths are wrong after packaging?
<img src="../img/ico_why.png"/>
After using it seems that the path is wrong too ng-src
, but after packaging, the path is still wrongbasePath
Why don’t you import the html template and use that template:
https://github.com/hjzheng/an...
Share a piece of code I wrote before:
As for the image path, I haven’t really studied it. Our products mainly use iconfont, so I’m looking for an answer