diff --git a/apps/angular/16-master-dependency-injection/src/app/app.component.ts b/apps/angular/16-master-dependency-injection/src/app/app.component.ts index 332ec9877..d2adee532 100644 --- a/apps/angular/16-master-dependency-injection/src/app/app.component.ts +++ b/apps/angular/16-master-dependency-injection/src/app/app.component.ts @@ -1,8 +1,12 @@ -import { TableComponent } from '@angular-challenges/shared/ui'; -import { AsyncPipe } from '@angular/common'; -import { ChangeDetectionStrategy, Component, Directive } from '@angular/core'; +import { AsyncPipe, CommonModule } from '@angular/common'; +import { + ChangeDetectionStrategy, + Component, + Directive, + Injector, +} from '@angular/core'; import { CurrencyPipe } from './currency.pipe'; -import { CurrencyService } from './currency.service'; +import { CURRENCY_CODE, CurrencyService } from './currency.service'; import { Product, products } from './product.model'; interface ProductContext { @@ -22,33 +26,53 @@ export class ProductDirective { } @Component({ - imports: [TableComponent, CurrencyPipe, AsyncPipe, ProductDirective], - providers: [CurrencyService], + imports: [CommonModule, CurrencyPipe, AsyncPipe], selector: 'app-root', template: ` -
- {{ col }} - | - } +{{ col }} | ||
---|---|---|---|
{{ product.name }} | -{{ product.priceA | currency | async }} | -{{ product.priceB | currency | async }} | -{{ product.priceC | currency | async }} | -
{{ product.name }} | +{{ product.priceA | currency | async }} | +{{ product.priceB | currency | async }} | +{{ product.priceC | currency | async }} | +