Here is my newly created component. I am looking to allow users to adjust the count variable.
import { Component, Inject } from '@angular/core';
@Component({
selector: 'app-likebtn',
templateUrl: './likebtn.component.html',
styleUrls: ['./likebtn.component.css']
})
export class LikebtnComponent {
selected: boolean = false
count: number = 0
constructor(count: number) {
this.count = count;
}
handleClick() {
this.selected = !this.selected
if(this.selected)
this.count++
else
this.count--
}
}
I have followed various tutorials and guides online, but I keep encountering errors such as the ones shown in this image: https://i.stack.imgur.com/MmqxE.png
Please assist me!
I have attempted using @Inject notation, recreating the component, and more without success. All I want is to include a constructor in my component.