angular-underscore
angular-underscore copied to clipboard
Problem with isolated scope
Methods which are added in to scope are not defined inside isolated scope. I previously had noticed some weird behaviour in "isSomething" methods, but now I was able to point the issue, when I had "range(1, 11)" used in ng-options. (now I know why "isEmpty" for example is not working in all of my views, reason is isolated scope.)
It worked previously when I wasn't using isolated scope, but when I made changes to the directive it stopped working. Finally I was able to narrow down the issue and made jsfiddle https://jsfiddle.net/RopoMen/sprgjnsm/
My own app is using Angular 1.2 series, but this fiddle is using 1.4.
Well, yes. This may not be even possible to do what I googled, but I would start looking for ways to decorate $rootScope and override $new method so that you could add required filter methods over there.
or just alter line 64: function register($rootScope) {$rootScope[methodName] = .bind([methodName], _);}
to
function register($rootScope) {$rootScope.__proto__[methodName] = _.bind(_[methodName], _);}