Hello all,
I’m pretty new to Ionic, started building an App a while ago. I wanted to include a 5-star rating component so I used the method explained here:
I followed all the instructions, the problem is I get an error when I call the ranking component in the html and I cant find why:
<app-rating [(rating)]='rating'></app-rating>
That’s what I have in the html, and the error reads “Identifier ‘rating’ is not defined. The component declaration, template variable declarations, and element references do not contain such a member”
This is the beginning of my .ts file:
import { Component, Input, EventEmitter ,Output} from "@angular/core";
@Component({
selector: 'app-rating',
templateUrl: './rating.component.html',
styleUrls: ['./rating.component.scss'],
})
export class RatingComponent {
@Input() rating: number ;
@Output() ratingChange: EventEmitter<number> = new EventEmitter();;
constructor() {}
Any help is really appreciated, as I’m just learning Angular/ionic, I don’t have all the knowledge to be able to find a solution on my own. I tried with no luck. Please help!
Thanks