Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 7 additions & 6 deletions src/app/app.module.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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: [
Expand All @@ -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
1 change: 1 addition & 0 deletions src/app/cart/cart.component.html
Original file line number Diff line number Diff line change
Expand Up @@ -3,3 +3,4 @@
{{i}} - {{product.name}}
</div>
</div>
<!-- Альтернативного блока не будет? Пункт 7 -->
1 change: 1 addition & 0 deletions src/app/product-component/product-component.component.ts
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ export class ProductComponentComponent implements OnInit {
}

onBuy() {
// я бы назвал buyEvent
this.handleBuy.emit(this.product);
}
}
1 change: 1 addition & 0 deletions src/app/services/products-service.service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -24,3 +24,4 @@ export class ProductsServiceService {
}];
}
}