1- import { Injectable } from '@angular/core' ;
2- import { Response } from '@angular/http' ;
3- import { Router } from '@angular/router' ;
1+ import { Injectable } from '@angular/core' ;
2+ import { Response } from '@angular/http' ;
3+ import { Router } from '@angular/router' ;
44
5- import { DataService } from '../shared/services/data.service' ;
6- import { SecurityService } from '../shared/services/security.service' ;
5+ import { DataService } from '../shared/services/data.service' ;
6+ import { SecurityService } from '../shared/services/security.service' ;
77import { IBasket } from '../shared/models/basket.model' ;
88import { IOrder } from '../shared/models/order.model' ;
99import { IBasketCheckout } from '../shared/models/basketCheckout.model' ;
10- import { BasketWrapperService } from '../shared/services/basket.wrapper.service' ;
11- import { ConfigurationService } from '../shared/services/configuration.service' ;
12- import { StorageService } from '../shared/services/storage.service' ;
10+ import { BasketWrapperService } from '../shared/services/basket.wrapper.service' ;
11+ import { ConfigurationService } from '../shared/services/configuration.service' ;
12+ import { StorageService } from '../shared/services/storage.service' ;
1313
14- import { Observable , Observer , Subject } from 'rxjs' ;
14+ import { Observable , Observer , Subject } from 'rxjs' ;
1515import { map , catchError } from 'rxjs/operators' ;
1616
1717@Injectable ( )
@@ -26,16 +26,16 @@ export class BasketService {
2626 //observable that is fired when the basket is dropped
2727 private basketDropedSource = new Subject ( ) ;
2828 basketDroped$ = this . basketDropedSource . asObservable ( ) ;
29-
29+
3030 constructor ( private service : DataService , private authService : SecurityService , private basketEvents : BasketWrapperService , private router : Router , private configurationService : ConfigurationService , private storageService : StorageService ) {
3131 this . basket . items = [ ] ;
32-
32+
3333 // Init:
3434 if ( this . authService . IsAuthorized ) {
3535 if ( this . authService . UserData ) {
3636 this . basket . buyerId = this . authService . UserData . sub ;
3737 if ( this . configurationService . isReady ) {
38- this . basketUrl = this . configurationService . serverSettings . purchaseUrl ;
38+ this . basketUrl = this . configurationService . serverSettings . purchaseUrl ;
3939 this . purchaseUrl = this . configurationService . serverSettings . purchaseUrl ;
4040 this . loadData ( ) ;
4141 }
@@ -53,7 +53,7 @@ export class BasketService {
5353 this . dropBasket ( ) ;
5454 } ) ;
5555 }
56-
56+
5757 addItemToBasket ( item ) : Observable < boolean > {
5858 this . basket . items . push ( item ) ;
5959 return this . setBasket ( this . basket ) ;
@@ -83,7 +83,7 @@ export class BasketService {
8383 }
8484 return response ;
8585 } ) ) ;
86- }
86+ }
8787
8888 mapBasketInfoCheckout ( order : IOrder ) : IBasketCheckout {
8989 let basketCheckout = < IBasketCheckout > { } ;
@@ -102,10 +102,10 @@ export class BasketService {
102102 basketCheckout . expiration = order . expiration ;
103103
104104 return basketCheckout ;
105- }
105+ }
106106
107107 dropBasket ( ) {
108- this . basket . items = [ ] ;
108+ this . basket . items = [ ] ;
109109 this . basketDropedSource . next ( ) ;
110110 }
111111
0 commit comments