Skip to content

Instantly share code, notes, and snippets.

@jessipearcy
Created October 6, 2020 14:53
Show Gist options
  • Save jessipearcy/c3a1521745758b38286bd1122baba021 to your computer and use it in GitHub Desktop.
Save jessipearcy/c3a1521745758b38286bd1122baba021 to your computer and use it in GitHub Desktop.
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