generator-fountain-webapp
generator-fountain-webapp copied to clipboard
template cache breakage- does not come last but before ngRoute?
Description
with gulp:build
template cache is not working. I have a app/ppv/ppv.html
template that the browser still requests and gets a file not found. I looked and I see the app/ppv/ppv.html
is in the ./tmp/templateCacheHtml.js
. I also see it in the minified code.
I had to use gulp-sourcemaps-1.6.0
because the newest version is broken. Not sure if that matters.
note: I have noticed on another fountainjs repo I have, which gulp build works, templatecache comes last instead of before ngRoute. Not sure if this is the root cause.
from app minified file:
angular.module("app", []).controller("PPVCtrl", ["$scope", function(e) {
document.body.style.height = "1800px",
e.$on("$destroy", function() {
document.body.style.height = "100%"
})
}
]),
angular.module("app").run(["$templateCache", function(e) {
e.put("app/ppv/ppv.html", '<div layout="column" layout-align="center center">\n <div style="height: 300px; width: 600px">\n <h1>filler</h1>\n </div>\n <div style="height: 500px; width: 600px; background: red">\n <h1>filler</h1>\n </div>\n <div style="height: 500px; width: 600px; background: red">\n <h1>filler</h1>\n </div>\n</div>\n\n')
}
]),
angular.module("app", ["ngMaterial", "ngRoute"]).config(["$mdThemingProvider", "$routeProvider", function(e, n) {
e.disableTheming(),
n.when("/PPV", {
templateUrl: "app/ppv/ppv.html",
controller: "PPVCtrl"
})
}
]);
//# sourceMappingURL=../maps/scripts/app-79b2fb90d1.js.map
Error: [$compile:tpload] Failed to load template: app/ppv/ppv.html (HTTP status: 404 Not Found)
Config
Copy the content from .yo-rc.json
:
{
"generator-fountain-angular1": {
"version": "0.7.2",
"props": {
"framework": "angular1",
"modules": "inject",
"js": "js",
"ci": [],
"css": "scss",
"resolved": "/home/one/.nvm/versions/node/v4.2.2/lib/node_modules/generator-fountain-webapp/node_modules/generator-fountain-angular1/generators/app/index.js",
"namespace": "fountain-angular1",
"argv": {
"remain": [],
"cooked": [],
"original": []
},
"sample": "techs",
"router": "none"
}
}
Environment
one@development ~/github/ohoh $ uname -a Linux development 4.1.15-gentoo-r1 #1 SMP Sat Jan 30 18:32:25 CST 2016 x86_64 QEMU Virtual CPU version 2.0.0 AuthenticAMD GNU/Linux
one@development ~/github/ohoh $ yo --version
1.8.4
one@development ~/github/ohoh $ npm --version
3.10.6
Node.js v4.2.2
linux 4.1.15-gentoo-r1
I was experiencing the same error, for a different reason. For the sake of others, the templateUrl requires a relative url to match the gulp-angular-templatecache generated template definitions. Trivial to find and replace, and obvious in hindsight, but rather puzzling when you finally get around to building and it fails.
I got same error , i don't know how to fix error
@tranhuy605 here is the workaround
Will this issue ever be fixed? Aside from the work around, It's a real blocker and keeps a app from being released to production