Raw html
Hi, would it be possible to pass raw html instead of a url to use with template: instead of templateUrl:
For a use case similar to this:
app.config(function($stateProvider) {
$stateProvider
.state('root', {
url: '/',
template: require('./components/root.jade')
});
});
loaders: [
{ test: /\.html$/, loader: 'ngtemplate?raw!html' },
{ test: /\.jade$/, loader: 'ngtemplate?raw!html!jade-html' }
]
If you want an inline template string than you don't need this plugin, as its purpose is to populate $templateCache which is used by templateUrl. Adding something like this - at the top of your file, as the readme points out - would probably work, and you just need jade-html-loader.
var template = require('./components/root.jade')
It would definitely be a nice thing to have. My use case: I want to be able to use both, raw html imports and templateCache.
I tried to refactor an app to use just raw html, but things like dynamic ng-include won't work. So I was thinking on doing templateCache + raw.
it can be implemented introducing a breaking change like the generated module export an object with url and content, not just an url.
var templateUrl = require('raw-loader!./mydirective.template.html'); {... template: templateUrl,