Here is the error in the browser console :
What happened is that Grunt uglify task included angular files (angular-route.js in this case).
Minification included in uglify task broke the file by minufying some string that mustn't be minified.
Three solutions :
- Make the grunt task do not include unwanted files, and include those files already minified in your app.
- If problem still occurs after first solution, your angular modules are not "uglify friendly". There's a special way to declare your dependencies so that minifying goes smooth, as described on this page ("a note on minification" paragraph) for example. Please note that instead of doing this declaration "by hand", you can use the "ng-min" task that automatize the process and keep your code clean.
- Well, in my case I still had issue, so I ended turning off the "mangle" option in uglify (that very option that make long strings into smaller to compress response size). You can turn off the option like this :
uglify: { options: { mangle: false },Hope this help.
Angular JS Online Training
ReplyDelete"Start your career by Joining Digital Marketing training with Gateway Techno Solution. We Here providing Digital Marketing training with real time experts
ReplyDeletefor more details contact use on gatewaytechnosolutions
Call Now: 9505066323 or 9505099323 "
Digital Marketing || Digital Marketing training ||
Gateway Techno Solutions @ kurnool
RKNews"For Your Latest News Updates Such As Entertainment , Politics, Sports , Lifestyles All
ReplyDeleteUnder one Umbrilla …"No:7036441765