diff --git a/src/app/app.module.ts b/src/app/app.module.ts index 92edb81..3640692 100644 --- a/src/app/app.module.ts +++ b/src/app/app.module.ts @@ -4,9 +4,9 @@ import { NgModule } from '@angular/core'; import { AppComponent } from './app.component'; import { ProductComponentComponent } from './product-component/product-component.component'; import { ProductListComponentComponent } from './product-list-component/product-list-component.component'; -import {ProductsServiceService} from './services/products-service.service'; +import { ProductsServiceService } from './services/products-service.service'; import { CartComponent } from './cart/cart.component'; -import {CartServiceService} from './services/cart-service.service'; +import { CartServiceService } from './services/cart-service.service'; @NgModule({ declarations: [ @@ -15,10 +15,11 @@ import {CartServiceService} from './services/cart-service.service'; ProductListComponentComponent, CartComponent ], - imports: [ - BrowserModule - ], + imports: [BrowserModule], + // Названия классов сервисов надо упростить ProductsServiceService -> ProductsService providers: [ProductsServiceService, CartServiceService], bootstrap: [AppComponent] }) -export class AppModule { } +export class AppModule {} + +// Посмотрите пункты 9, 12.7 diff --git a/src/app/cart/cart.component.html b/src/app/cart/cart.component.html index 63b6d26..eab83cf 100644 --- a/src/app/cart/cart.component.html +++ b/src/app/cart/cart.component.html @@ -3,3 +3,4 @@ {{i}} - {{product.name}} + diff --git a/src/app/product-component/product-component.component.ts b/src/app/product-component/product-component.component.ts index 15aed52..4080763 100644 --- a/src/app/product-component/product-component.component.ts +++ b/src/app/product-component/product-component.component.ts @@ -18,6 +18,7 @@ export class ProductComponentComponent implements OnInit { } onBuy() { + // я бы назвал buyEvent this.handleBuy.emit(this.product); } } diff --git a/src/app/services/products-service.service.ts b/src/app/services/products-service.service.ts index b42dfb2..8992211 100644 --- a/src/app/services/products-service.service.ts +++ b/src/app/services/products-service.service.ts @@ -24,3 +24,4 @@ export class ProductsServiceService { }]; } } +