Ricardo Amaral
Member since Jan 31, 2015
- Profile: /members/12518-ricardo-amaral.htm
- URL: http://ricardoamaral.net
- Comments: 2
Recent Blog Comments By Ricardo Amaral
-
Creating And Extending A Lodash / Underscore Service In AngularJS
Posted on Feb 1, 2015 at 6:14 AM
@Ricardo, I remembered a small issue with my implementation, $provide.value is going to create a mutable value, which allows anyone to rewrite it anywhere. However, I tried the same for a constant and factory and I could still rewrite the lodash injection in one place and then get an undefined erro... read more »
-
Creating And Extending A Lodash / Underscore Service In AngularJS
Posted on Jan 31, 2015 at 5:20 PM
I'm not fond of the idea of injecting '_' on run() just to clear the global scope. What about the following approach: app.config(['$provide', function ($provide) { $provide.value('_', window._); delete window._; }]); I know I'm using the global 'window' instead of '$window' but it's just f... read more »