Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add $watchGroup #10

Open
gabrielmaldi opened this issue Mar 14, 2016 · 4 comments
Open

Add $watchGroup #10

gabrielmaldi opened this issue Mar 14, 2016 · 4 comments

Comments

@gabrielmaldi
Copy link

A feature request very similar to #4 but for $watchGroup.

Thanks!

@sashberd
Copy link

sashberd commented Nov 30, 2016

Hey
I was need also such behavior, and as I see its development is not in progress. Thus, here my solution for this issue:

ctrlImpl.prototype.$watchGroup = function () {
         var args = arguments, watchExpr = args[0];     
         watchExpr.forEach(function (item,index,array) {
             var getExpr = $parse(item);
             array[index] = function () { return getExpr(instance); }
         });
         return $scope.$watchGroup.apply($scope, args);          
     }

Just add it inside angular-360-no-scope.js file after $watch prototype overriding.
Hope this helps

@gabrielmaldi
Copy link
Author

Thank you, @sashberd!

@christopherthielen
Copy link
Owner

Put this in a PR and I'll merge it!

@sashberd
Copy link

sashberd commented Dec 1, 2016

I have no idea how to put this to PR so I leave this to you

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

No branches or pull requests

3 participants