jfci9q
Last Updated: February 07, 2017
·
3.048K
· hauleth
Me

Using Angular.js and Uglify in Rails?

If your models use Angular dependency magic, like:

function HelloController($scope, $http) {
  // ...
}

Don't forget to add:

config.assets.js_compressor = Uglifier.new(mangle: false) if defined? Uglifier

Or explicitly use HelloController.$inject = ['$scope', '$http'].

Say Thanks
Respond

4 Responses
Add your response

8203
Photo on 08.01.2013 at 04.15

Uglify.new should be Uglifier.new

over 1 year ago ·
8204
Photo on 08.01.2013 at 04.15

Or more precisely:

config.assets.js_compressor = Uglifier.new(:beautify => true) if defined? Uglifier

over 1 year ago ·
11719
Screen shot 2013 01 13 at 12.05.29 am

thanks for sharing, i had the same case, after production deployment it was showing up some weird error. 't' module was not loaded. so later disabling mangling solved the problem.

over 1 year ago ·
28577

You sir, I like you. Give me your BTC address to invite you a beer.

10 months ago ·