File

projects/congarevenuecloud/elements/src/lib/product-drawer/product-drawer.service.ts

Description

Product Drawer service is used to check Drawer status(open/close).

Usage

Example :
import { ProductDrawerService, AObjectService} from '@congarevenuecloud/ecommerce';

export class MyComponent implements OnInit{
constructor( private productDrawerService: ProductDrawerService)
}
// or
export class MyService extends AObjectService {
private productDrawerService: ProductDrawerService = this.injector.get(ProductDrawerService);
}

Index

Methods

Methods

Public closeDrawer
closeDrawer()

To close the drawer

Example:

Example :
import { ProductDrawerService } from '@congarevenuecloud/ecommerce';
import { Observable } from 'rxjs/Observable';

export class MyComponent implements OnInit{
constructor(private productDrawerService: ProductDrawerService){}

closeDrawer(){
this.productDrawerService.closeDrawer();
}
}
Returns : void
Public isDrawerOpen
isDrawerOpen()

check drawer is open or close

Example:

Example :
import { ProductDrawerService } from '@congarevenuecloud/ecommerce';
import { Observable } from 'rxjs/Observable';

export class MyComponent implements OnInit{
isOpen$: Observable<boolean>;
isOpen: boolean;

constructor(private productDrawerService: ProductDrawerService){}

isDrawerOpen(){
this.productDrawerService.isDrawerOpen().subscribe(a => this.isOpen = a);
// or
this.isOpen$ = this.productDrawerService.isDrawerOpen();
}
}
Returns : Observable<boolean>

Observable true if drawer is open and false if it is close

Public openDrawer
openDrawer()

TO open the drawer

Example:

Example :
import { ProductDrawerService } from '@congarevenuecloud/ecommerce';
import { Observable } from 'rxjs/Observable';

export class MyComponent implements OnInit{
constructor(private productDrawerService: ProductDrawerService){}

openDrawer(){
this.productDrawerService.openDrawer();
}
}
Returns : void
Public toggleDrawer
toggleDrawer()

toggle the drawer action. close if it is open or vice versa

Example:

Example :
import { ProductDrawerService } from '@congarevenuecloud/ecommerce';
import { Observable } from 'rxjs/Observable';

export class MyComponent implements OnInit{
constructor(private productDrawerService: ProductDrawerService){}

toggleDrawer(){
this.productDrawerService.toggleDrawer();
}
}
Returns : void

results matching ""

    No results matching ""