Created
October 6, 2020 14:53
-
-
Save jessipearcy/c3a1521745758b38286bd1122baba021 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
export class AllHabitsComponent implements OnInit { | |
@Output() addEvent = new EventEmitter(); | |
@Output() editEvent = new EventEmitter<Habit>(); | |
public habits: Habit[]; | |
constructor() {} | |
ngOnInit(): void { | |
this.habits = HABITS; | |
} | |
onAdd() { | |
this.addEvent.emit(); | |
} | |
onEdit(habit: Habit) { | |
this.editEvent.emit(habit); | |
} | |
public onDelete(index: number) { | |
this.habits.splice(index, 1); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment