Skip to content

Instantly share code, notes, and snippets.

@brunokrebs
Created March 2, 2017 14:32
Show Gist options
  • Save brunokrebs/f550d027ffece1c463ff00d1a12db6dc to your computer and use it in GitHub Desktop.
Save brunokrebs/f550d027ffece1c463ff00d1a12db6dc to your computer and use it in GitHub Desktop.
import { Component, EventEmitter, Output } from '@angular/core';
@Component({
selector: 'app-task-form',
templateUrl: './task-form.component.html',
styleUrls: ['./task-form.component.css']
})
export class TaskFormComponent {
@Output()
taskAdded = new EventEmitter();
public task: String = null;
addTask() {
this.taskAdded.emit(this.task);
this.task = null;
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment