gulp templatecache and using html URL for Dialog box

北城余情 提交于 2020-01-25 14:26:05

问题


Hi I am using the gulp plugin, to create template of all my partials and later merge it with application js script and minified.

var partials: ['app/**/*.html', '!app/index.html', '!app/bower_components/**/*.html'],

    gulp.src(partials)           
   .pipe(plugins.angularTemplatecache("templates.js", {module: "mainApp", root: "app/"}));

All .html load properly but when I try to specify html as part of some dialog box plugin inside some controller (I am using ng-material) it throws 404. ex -

$mdDialog.show({
                controller: 'entityGridCtrl',
                templateUrl: 'user/partials/entityGrid.html'
            });

回答1:


In your gulp task, the root: path must match how your reference the html. So, change root: "app/" to root: "user/partials". (Or vice-versa)



来源:https://stackoverflow.com/questions/29399453/gulp-templatecache-and-using-html-url-for-dialog-box

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!