Closed AGuyCoding closed 6 years ago
Okay for others like me, this setup worked for me
inside webpack-2-config
{ test: /\.html$/, use: [{ loader: "ng-cache-loader", options: { prefix: path.join(__dirname, '/Views:[dirs]'), exportId: false, minimizeOptions: { removeComments: true, removeCommentsFromCDATA: true, collapseWhitespace: true, conservativeCollapse: false, preserveLineBreaks: true, removeEmptyAttributes: true, keepClosingSlash: true, }, }, }], }
the important part is the prefix
so i can call the templates like
<div ng-include="'someFolder/index.html'"></div> <br />
With a structure like that: +-- scripts +--- foo +----- a.js +--- bar +----- b.js
+-- views +--- foo +----- index.html +--- bar +----- index.html +--- shared +----- index.html
how can one import "views/bar/index.html" AND "views/shared/index.html" within "scripts/bar/b.js" ? the html files are all called the same "index.html", what can we do to "ng-include" both files?