forked from mahmudka/project-ngx-shop-task-book
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Mikhail Nazyrov
committed
May 27, 2021
1 parent
b5c4779
commit ca6c0e9
Showing
5 changed files
with
35 additions
and
10 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
12 changes: 8 additions & 4 deletions
12
1-components/3-category-product-card/src/app/product-card/product-card.component.html
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
22 changes: 20 additions & 2 deletions
22
1-components/3-category-product-card/src/app/product-card/product-card.component.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,8 +1,26 @@ | ||
import { Component, ChangeDetectionStrategy } from '@angular/core'; | ||
import { Component, Input, Output, ChangeDetectionStrategy, EventEmitter } from '@angular/core'; | ||
import { IProduct} from '../../../../../shared/mocks/1-components/product'; | ||
|
||
@Component({ | ||
selector: 'ngx-shop-content-product', | ||
templateUrl: './product-card.component.html', | ||
changeDetection: ChangeDetectionStrategy.OnPush, | ||
}) | ||
export class CategoryProductComponent {} | ||
export class CategoryProductComponent { | ||
@Input() | ||
public product: IProduct = {} as IProduct; | ||
|
||
@Output() | ||
public addToCart = new EventEmitter(); | ||
|
||
@Output() | ||
public goToProduct = new EventEmitter(); | ||
|
||
public addToBasket(): void { | ||
this.addToCart.emit(); | ||
} | ||
|
||
public redirectTo(): void { | ||
this.goToProduct.emit(); | ||
} | ||
} |