Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <td>
- <small ng-show="isLoggedIn">
- <subscribe class="pull-right"
- resource="project"
- resource-id="project.id"
- subsList="subsList"
- ></subscribe>
- </small>
- </td>
- angular.module('sb.util').directive('subscribe',
- function (CurrentUser, Notification, Priority, SessionState, Session,
- Subscription) {
- 'use strict';
- return {
- restrict: 'E',
- scope: {
- resource: '@',
- resourceId: '=',
- subsList: '@'
- },
- templateUrl: 'app/subscription/template/subscribe.html',
- link: function ($scope) {
- <old stuff and then....>
- function resolveSubsList() {
- if (!Session.isLoggedIn()) {
- setSubscription();
- return;
- }
- $scope.resolving = true;
- cuPromise.then(
- function (user) {
- console.log($scope.resourceId);
- console.log($scope.subsList);
- if ($scope.resourceId == "subsList[i]"){
- setSubscription(true);
- $scope.resolving = false;
- }
- else setSubscription(false);
- $scope.resolving =false;
- }
- );
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement