ng-table
ng-table copied to clipboard
404 of "paper.html" and "header.html" when rendering ng-table
environment: Webpack3 + ES2015 + ng-table 3.0.1 + angular 1.6.5
I googled it and found some similar issues but they didn't work. Is it a bug or my environment issue?
Yeah i got this error too. Can someone explain how to fix this? When i use ver 2.2.0 (https://unpkg.com/[email protected]/bundles/ng-table.min.js), it's work without error.
Thanks
New Update : @329530588, i think the error appear if you install ng-table from the webpack, I already solved this problem when i include js file from bundles folder.
Thanks for sharing! @aldoetobex Did you mean include ng-table through
The solution is to edit directives in the src/browser/ and replace all occurrences of templateUrl
with template
so webpack will load the templates as inline string rather than external resource.
I found a solution that doesn't require editing the ng-table code. Details here: https://github.com/esvit/ng-table/issues/969#issuecomment-703458126. Summary: install the ngtemplate-loader
and html-loader
NPM packages, then put this in your webpack.config.js (example is for Webpack 3.x, hopefully should work in 2.x or 4.x with possible adjustments to where the line goes in the config):
module: {
rules: [
// ...
{ test: /ng-table\/.*\.html$/, use: ['ngtemplate-loader?requireAngular&relativeTo=/src/browser/&prefix=ng-table/', 'html-loader'] }
]
}