Archive for June, 2014

AngularJS ngMin Json Properties

One thing I ran across using these tools while trying to lazy load routes/pages was the inability to properly compress the JSON Object properties. One of the workarounds, specifically for a templateUrl in this case works like so (you have to specify that you want the function value, and not the first value returned from the array.

templateUrl: ["$stateParams", function($stateParams){
var templateUrl = "views/folder/" + $stateParams.page + ".html";
return templateUrl;
}][1],
© 2012 - Jeff Ancel
Wordpress Themes
Scroll to Top