I recently started to learn to use Angular 14, but I have a problem. I want to use the property "total" that was created in a component, but got that error "Type 'string' is not assignable to type 'number'".
The app.component.html code is:
<div>
<app-header></app-header>
<app-total mensaje="Total por pagar: " total="5000"></app-total>
<app-items></app-items>
</div>
While the component having the "total" property, total.component.ts is:
import { Component, Input, OnInit } from '@angular/core';
@Component({
selector: 'app-total',
templateUrl: './total.component.html',
styleUrls: ['./total.component.css']
})
export class TotalComponent implements OnInit {
@Input() total:number = 0;
@Input() mensaje:string = '';
constructor() { }
ngOnInit(): void {
}
}