Encountering this issue:
ERROR in src\app\shopping-cart-summary\shopping-cart-summary.component.html(15,42): : Property '$' does not exist on type 'ShoppingCartSummaryComponent'.
The error disappears when I remove the currency pipes.
I have experimented with various combinations of pipes recently, including:
'$'
"$"
$
"true"
'true'
true
What could be causing this mistake?
<div class="card">
<div class="card-body">
<h5 class="card-title">Order Summary</h5>
<p class="card-text">You have {{cart.totalItemsCount }} items in your shopping cart.</p>
<ul class="list-group list-group-flush">
<li *ngFor="let item of cart.items" class="list-group-item">
{{item.quantity}} x {{item.title}}
<div class="float-right">
{{item.totalPrice | currency: "USD": $ }}
</div>
</li>
<li class="list-group-item font-weight-bold">
Total
<div class="float-right">
{{cart.totalPrice | currency: "USD": $ }}
</div>
</li>
</ul>
</div>
</div>
I can simply add a $
before these elements. However, I am curious to know the root of the problem!
I am also experiencing strange behavior with these pipes within my data table.
I have applied the same combinations here as well.
<p>
<a routerLink="/admin/products/new" class="btn btn-primary">New Product</a>
</p>
<p>
<input #query (keyup)="filter(query.value)" type="text" class="form-control" placeholder="Title Search">
</p>
<data-table [items]="items" [itemCount]="itemCount" (reload)="reloadItems($event)">
<data-table-column [property]="'title'" [header]="'Title'" [sortable]="true" [resizable]="true">
</data-table-column>
<data-table-column [property]="'price'" [header]="'Price'" [sortable]="true" [resizable]="true">
</data-table-column>
<ng-template #dataTableCell let-item="item"> {{item.price|currency: 'USD' : '$'}}></ng-template>
<data-table-column [property]="'$key'" [width]="100">
<ng-template #dataTableCell let-item="item">
<a [routerLink]="['/admin/products/', item.$key]">
<i class="fa fa-pencil-square-o"
aria-hidden="true"></i>
</a>
</ng-template>
</data-table-column>
</data-table>
Required Dependencies:
"dependencies": {
"@angular/animations": "^5.2.0",
"@angular/common": "^5.2.0",
"@angular/compiler": "^5.2.0",
"@angular/core": "^5.2.0",
"@angular/forms": "^5.2.0",
"@angular/http": "^5.2.0",
"@angular/platform-browser": "^5.2.0",
"@angular/platform-browser-dynamic": "^5.2.0",
"@angular/router": "^5.2.0",
"@ng-bootstrap/ng-bootstrap": "^1.0.0",
"@swimlane/ngx-datatable": "^11.1.7",
"angular5-data-table": "^0.5.1",
"angularfire2": "^5.0.0-rc.6",
"bootstrap": "^4.0.0",
"core-js": "^2.4.1",
"firebase": "^4.9.1",
"font-awesome": "^4.7.0",
"ng2-validation": "^4.2.0",
"rxjs": "^5.5.6",
"zone.js": "^0.8.19"
},
"devDependencies": {
"@angular/cli": "^1.7.0",
"@angular/compiler-cli": "^5.2.0",
"@angular/language-service": "^5.2.0",
"@types/jasmine": "~2.8.3",
"@types/jasminewd2": "~2.0.2",
"@types/node": "~6.0.60",
"codelyzer": "^4.0.1",
"jasmine-core": "~2.8.0",
"jasmine-spec-reporter": "~4.2.1",
"karma": "~2.0.0",
"karma-chrome-launcher": "~2.2.0",
"karma-coverage-istanbul-reporter": "^1.2.1",
"karma-jasmine": "~1.1.0",
"karma-jasmine-html-reporter": "^0.2.2",
"protractor": "~5.1.2",
"ts-node": "~4.1.0",
"tslint": "~5.9.1",
"typescript": "~2.5.3"
},