Skip to content
This repository has been archived by the owner on Jan 27, 2024. It is now read-only.

Problem with isolated scope #22

Open
RopoMen opened this issue Aug 3, 2015 · 3 comments
Open

Problem with isolated scope #22

RopoMen opened this issue Aug 3, 2015 · 3 comments

Comments

@RopoMen
Copy link

RopoMen commented Aug 3, 2015

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.

@RopoMen
Copy link
Author

RopoMen commented Aug 3, 2015

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.

@RopoMen
Copy link
Author

RopoMen commented Aug 3, 2015

or just alter line 64:
function register($rootScope) {$rootScope[methodName] = .bind([methodName], _);}

to

function register($rootScope) {$rootScope.__proto__[methodName] = _.bind(_[methodName], _);}

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants
@RopoMen and others