teux / ng-cache-loader

Webpack loader to put HTML partials in the Angular's $templateCache.
83 stars 15 forks source link

weird template path #2

Closed margielm closed 9 years ago

margielm commented 9 years ago

Hello,

I fallowed the documentation and created a simple directive:

require('./template.html');

/* @ngInject */
function TimeDirective() {
    return {
        template: 'template.url'
    }
}
module.exports = TimeDirective;

but then looking at generated file path is completely wrong:

function(module, exports, __webpack_require__) {

    var v1="<div> Time </div>";
    angular.module(["ng"]).run(["$templateCache",function(c){c.put("C:\project\src\scripts\time\template.html", v1)}]);
    module.exports=v1;

}

My configuration of loader:

            {
                test: /template.html$/,
                loader: 'ng-cache'
            }

I also tried using different values of prefix parameter. But this was just adding prefix in front of the whole path.

teux commented 9 years ago

I forgot about Windows users ) Please update loader and try again

margielm commented 9 years ago

I think that the word is "discrimination" ;)

thanks! now it works perfectly!