Open m0ppers opened 9 years ago
Yes I see how that way is better. But I don't see why you are using apply-loader in the test? Doesn't your change make it un-necessary?
This is related to the jade loader. It will return a function (so you can supply template variables). ng-template however will require a string. To do the conversion the apply loader is needed. Without it the ngtemplate would be the function body of the jade loader which is not really helpful :)
Got it thanks. Will do some testing this weekend.
There is not only one use case of yours. In common case, ngtemplate-loader process a string with module.exports = .....
. Therefore, you can chain another loader like raw
or html
before ngtemplate
to get it work but not change its source to poor compatibility.
…ng magic
I am trying to use jade templates as partials and I simply couldn't get it to run.
the jade loader is returning a function and I am picking it up, create the final template string by piping it through apply and then I want to pipe the result to ngtemplate.
This is the result:
After digging into the code I stumpled upon the string magic (/module.exports/) in this module. I am a total newbie to webpack but this doesn't seem to be the correct way to do it.
I had a look here:
https://github.com/mogelbrod/apply-loader/blob/master/index.js
and this seems to be a solid way to properly chain loaders.