ngtemplate-loader icon indicating copy to clipboard operation
ngtemplate-loader copied to clipboard

Parameter Interpolation

Open IdanCo opened this issue 8 years ago • 1 comments

I'm trying to make my code more pretty by replacing this - templateUrl: 'foo/bar.template.jade' with this templateUrl: 'foo/bar'

Something similar was implemented in PR #35 which was dismissed by @WearyMonkey who said

The same effect can now be achieved with parameter interpolation in 2.0.0.

But even after reading Parameter Interpolation, and subsequently Webpack's standard interpolation rules, I still can't wrap my head around this.

Could anyone please provide some example how this can be achieved?

IdanCo avatar Jul 12 '17 10:07 IdanCo

found a little hack that does the job thanks to @GuyPie -

loader: 'ngtemplate-loader?relativeTo=[path][name].[ext]&prefix=[1]&prefixRegExp=\\/foo\\/(.*)\\.template\\.jade'

IdanCo avatar Jul 12 '17 11:07 IdanCo