ng-table icon indicating copy to clipboard operation
ng-table copied to clipboard

404 of "paper.html" and "header.html" when rendering ng-table

Open Jaycexx opened this issue 7 years ago • 4 comments

environment: Webpack3 + ES2015 + ng-table 3.0.1 + angular 1.6.5 1499935265 1

I googled it and found some similar issues but they didn't work. Is it a bug or my environment issue?

Jaycexx avatar Jul 13 '17 08:07 Jaycexx

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.

aldoetobex avatar Jul 25 '17 21:07 aldoetobex

Thanks for sharing! @aldoetobex Did you mean include ng-table through

Jaycexx avatar Aug 10 '17 09:08 Jaycexx

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.

fadehelix avatar Sep 01 '18 17:09 fadehelix

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'] }
      ]
    }

rmunn avatar Oct 05 '20 07:10 rmunn