Open faceleg opened 7 years ago
@faceleg have you been able to resolve that issue? I'm upgrading an AngularJS 1.5 app to Webpack 2 and see a GET http://app.finderbox.dev/app/ng-table/pager.html 404 (Not Found)
in the browser log.
@richtmat no I gave up and have been using webpack 1. Very interested in a solution though
I think this might actually be related to ngtemplate-loader
when specifying relativeTo
. I'm not getting any errors about not finding http://app.finderbox.dev/...
though. Might be related: webpack-contrib/html-loader#91. I'm using webpack@2.2.1
and ng-table@3.0.1
.
On your test
for .html
, try removing relativeTo
and running Webpack. For me, it compiles fine, and the ng-table templates are added to the cache. Crack open your bundle and check it out.
Since we'll still need a prefix, I'm messing around with having a loader/test block for my app and a separate block for node_modules.
@mheppner unfortunately, for me it does not change a thing (here and https://github.com/esvit/ng-table/issues/969).
Only difference is that local templates are wrong as well. The url ending on .dev
is my local development url, you obviously cannot go there.
As I said in https://github.com/esvit/ng-table/issues/969 , I put the template content of the bundle in my files. The templates are put into the cache like this: $templateCache.put('ng-table/pager.html', html);
. I still struggle to find out if its a ng-table or webpack issue...
Up, same error here
Yo, I was able to solve this by changing how I import ng-table into my project. Importing directly from the bundle fixed it for me:
import 'ng-table/bundles/ng-table';
Works great: import 'ng-table/bundles/ng-table';
Same problema here. When importing like
import { ngTableModule } from 'ng-table';
then the header and footer are not bundled resulting in a HTTP 404.
Changing the import to
import 'ng-table/bundles/ng-table';
solves the header/footer problem but there's a glitch missing: the ^ and v sorting indicators are not shown. Sorting happens but there is no visual indication.
Any ideas?
@sargue This is a few months late, but I myself ran into the same problem with the sorting ^ and v not showing.
Add
import 'ng-table/bundles/ng-table.css';
:)
Thanks @jheimbouch , I can't try it because I'm no longer working on that project. But thanks anyway, I may be useful for somebody else.
I was able to get the HTML files compiling properly with Webpack by putting the following in my webpack.config.js:
module: {
rules: [
// ...
{ test: /ng-table\/.*\.html$/, use: ['ngtemplate-loader?requireAngular&relativeTo=/src/browser/&prefix=ng-table/', 'html-loader'] }
]
}
This also requires the NPM packages ngtemplate-loader
and html-loader
. Full details: https://github.com/esvit/ng-table/issues/969#issuecomment-703458126
Trying to upgrade to webpack 2, my build fails with the following error:
Importing library (fails):
Requiring bundle (success):
webpack config: