Advertisement
Guest User

Untitled

a guest
Oct 2nd, 2015
83
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Diff 1.51 KB | None | 0 0
  1. diff --git a/src/app/subscription/directive/subscribe.js b/src/app/subscription/directive/subscribe.js
  2. index 09b3655..010fbb3 100644
  3. --- a/src/app/subscription/directive/subscribe.js
  4. +++ b/src/app/subscription/directive/subscribe.js
  5. @@ -176,10 +176,6 @@ angular.module('sb.util').directive('subscribe',
  6.                      }
  7.                  };
  8.  
  9. -                $scope.subscriptions = $scope.subscriptions;
  10. -
  11. -                var i;
  12. -
  13.                  /** Set subscriptions based on list passed from
  14.                  * stories/projects/project_groups controller(s)
  15.                  */
  16. @@ -194,12 +190,13 @@ angular.module('sb.util').directive('subscribe',
  17.  
  18.                      cuPromise.then(
  19.                          function () {
  20. -                            for (i in $scope.subscriptions){
  21. -                                if ($scope.resourceId ===
  22. -                                        $scope.subscriptions[i].target_id) {
  23. -                                    setSubscription($scope.subscriptions[i]);
  24. +                            angular.forEach($scope.subscriptions,
  25. +                                function(sub) {
  26. +                                    if ($scope.resourceId === sub.target_id) {
  27. +                                        setSubscription(sub);
  28. +                                    }
  29.                                  }
  30. -                            }
  31. +                            );
  32.                              $scope.resolving = false;
  33.                          }
  34.                      );
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement