Advertisement
Guest User

Untitled

a guest
Sep 10th, 2015
72
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.59 KB | None | 0 0
  1. <td>
  2. <small ng-show="isLoggedIn">
  3. <subscribe class="pull-right"
  4. resource="project"
  5. resource-id="project.id"
  6. subsList="subsList"
  7. ></subscribe>
  8. </small>
  9. </td>
  10.  
  11.  
  12.  
  13. angular.module('sb.util').directive('subscribe',
  14. function (CurrentUser, Notification, Priority, SessionState, Session,
  15. Subscription) {
  16. 'use strict';
  17.  
  18. return {
  19. restrict: 'E',
  20. scope: {
  21. resource: '@',
  22. resourceId: '=',
  23. subsList: '@'
  24. },
  25. templateUrl: 'app/subscription/template/subscribe.html',
  26. link: function ($scope) {
  27.  
  28.  
  29. <old stuff and then....>
  30.  
  31. function resolveSubsList() {
  32.  
  33. if (!Session.isLoggedIn()) {
  34. setSubscription();
  35. return;
  36. }
  37.  
  38. $scope.resolving = true;
  39.  
  40. cuPromise.then(
  41. function (user) {
  42. console.log($scope.resourceId);
  43. console.log($scope.subsList);
  44. if ($scope.resourceId == "subsList[i]"){
  45. setSubscription(true);
  46. $scope.resolving = false;
  47. }
  48. else setSubscription(false);
  49. $scope.resolving =false;
  50. }
  51.  
  52. );
  53. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement