Grunt Dist Server won't load ng-templates, looks for views directly even though ngTemplates are generated.
See original GitHub issueHi Eric & everyone!
I spent 5+ hours and looked at the previous issues, but I can’t seem to crack my issue. Hopefully you can provide some insight.
When I run my grunt serve:dist after I built, my app looks for the templates directly, even though my scripts has my generated templates included and my tmp folder has a fully created templateCache.js with all my views in js.
My chrome browser goes crazy looking for the first template in my initial state, i’m using ui-router for angular states. It won’t load the first state template, nor will it load directly referenced templates. However in my regular grunt serve I have no errors. No console errors. Nothing. Every feature works fine.
I read previously to check all my formats, I can confirm that there are no ng-includes or templateUrl in my App.js which has an irregular format. But again all references work fine in my grunt serve version, just not my dist serve.
If I copy and past the views folder (I am using the yeoman generated format) into my dist, the templates come right up, but obviously I want my angular app to recognize my templates.
Last thing I changed my logic for one of my views trying to be fancy with the ngClass…
<div ng-class="toggleSideMenuNavView()" class="baseSideNav">
<div ng-include=" 'views/Shared/_SideMenu.html' "></div> (<- spaces for distinction)
</div>
Let me know what additional information you may need and thank you to you and everyone in advance.
Dennis O.
Issue Analytics
- State:
- Created 8 years ago
- Comments:5
Top GitHub Comments
@underscorebrody - Thanks! His answer caused me to look at syntax around my issue. It turned out that my app folder name for the angular module was camelcase, but the module name itself was lowercase. In our build process, we use the module name as part of the new templateUrl path. That meant the view was declared in our route as templateUrl: xxXX/… but the build path was actually xxxx/, which explains why a static html file was being looked for outside of the templateCache.
@daniel-nalbach I believe he means his immediately invoked function expression (IIFE).