[Fixed] property binding error when pipes is used


i am following this tutorial


and i am trying to get the code posted below working. when i invoke the command

ng servr --open

i get the following error:

Error occurs in the template of component Appcomponent
ptoperty file does not exist on type Appcomponent

please let me know why i am getting this error and how to fix it


import { Component } from '@angular/core'
    selector: 'app-root',
    templateUrl: './app.component.html'
export class AppComponent {
    file = { name: 'logo.svg', size: 2120109, type: 'image/svg' };



{{file.size | filesize}}


For using pipe we need to pass it in provider

I have created stackblitz demo you can check, it is working fine in my case I have attached here so you can check.

let me know if you still face any issue will help you.


enter image description here

Leave a Reply

(*) Required, Your email will not be published