diff options
Diffstat (limited to 'ufund-ui/src/app/components/funding-basket')
| -rw-r--r-- | ufund-ui/src/app/components/funding-basket/funding-basket.component.html | 17 | ||||
| -rw-r--r-- | ufund-ui/src/app/components/funding-basket/funding-basket.component.ts | 5 | 
2 files changed, 10 insertions, 12 deletions
diff --git a/ufund-ui/src/app/components/funding-basket/funding-basket.component.html b/ufund-ui/src/app/components/funding-basket/funding-basket.component.html index 0a880af..dd02e98 100644 --- a/ufund-ui/src/app/components/funding-basket/funding-basket.component.html +++ b/ufund-ui/src/app/components/funding-basket/funding-basket.component.html @@ -2,33 +2,33 @@  <div id="needCount">      <label for="needCount">Needs in Basket:</label> -    <span>{{ needCount }}</span> +    <span>{{ this.usersService.getBasket().getValue().length }}</span>  </div> -<div *ngIf="isBasketEmpty"> +<div *ngIf="this.usersService.getBasket().getValue().length == 0">      <h2>There are no needs in the basket</h2>  </div> -<table class="needs" *ngIf="!isBasketEmpty"> +<table class="needs" *ngIf="this.usersService.getBasket().getValue().length != 0">      <thead>          <tr>              <th class="need"></th>          </tr>      </thead>      <tbody> -        <tr *ngFor="let need of basket"> +        <tr *ngFor="let need of usersService.getBasket().getValue()">              <td>                  <a routerLink="/need/{{need.id}}">                      {{need.name}}                  </a>                  <div> -                <button type="button" class="addNeed" title="add need" -                (click)="addNeed(need)">Add Need</button> +                <!-- <button type="button" class="addNeed" title="add need" +                (click)="addNeed(need)">Add Need</button> -->                  </div>                  <br>                  <div>                  <button type="button" class="removeNeed" title="delete need" -                (click)="removeNeed(need)">Remove Need</button> +                (click)="this.usersService.removeNeed(need.id)">Remove Need</button>                  </div>              </td>          </tr> @@ -36,6 +36,5 @@  </table>  <br>  <div> -    <button type="submit" class="checkout" title="checkout" -    (click)="checkout()">Checkout</button> +    <button type="submit" class="checkout" title="checkout">Checkout</button>  </div>
\ No newline at end of file diff --git a/ufund-ui/src/app/components/funding-basket/funding-basket.component.ts b/ufund-ui/src/app/components/funding-basket/funding-basket.component.ts index bc7f087..061e3fa 100644 --- a/ufund-ui/src/app/components/funding-basket/funding-basket.component.ts +++ b/ufund-ui/src/app/components/funding-basket/funding-basket.component.ts @@ -14,12 +14,11 @@ import { BehaviorSubject, firstValueFrom } from 'rxjs';      styleUrl: './funding-basket.component.css'  })  export class FundingBasketComponent implements OnInit { -  basket = new BehaviorSubject<Need[]>([]);    constructor(      private router: Router, -    private cupboardService: CupboardService,  -    private usersService: UsersService +    protected cupboardService: CupboardService,  +    protected usersService: UsersService    ) {}    // this is for login rerouting  | 
