Skip to content
This repository has been archived by the owner on Feb 27, 2019. It is now read-only.

template cache breakage- does not come last but before ngRoute? #154

Open
dman777 opened this issue Oct 27, 2016 · 4 comments
Open

template cache breakage- does not come last but before ngRoute? #154

dman777 opened this issue Oct 27, 2016 · 4 comments

Comments

@dman777
Copy link

dman777 commented Oct 27, 2016

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

@dman777 dman777 changed the title gulp build - template cache- browser request html regardless template cache breakage- does not come last but before ngRoute? Oct 27, 2016
@tristanmarsh
Copy link

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.

@tranhuy605
Copy link

I got same error , i don't know how to fix error

@dman777
Copy link
Author

dman777 commented Dec 4, 2016

@dman777
Copy link
Author

dman777 commented Dec 4, 2016

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

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants