Skip to content

Instantly share code, notes, and snippets.

@robwormald
Created November 23, 2016 22:43
Show Gist options
  • Save robwormald/7f95c3e4b9ff7b0da056cbe8485708a5 to your computer and use it in GitHub Desktop.
Save robwormald/7f95c3e4b9ff7b0da056cbe8485708a5 to your computer and use it in GitHub Desktop.
@Component({
selector: 'child-dumb-component',
template: `
<button>clicky</button>
`
})
export class ChildDumbComponent {
@Output() customEvent = new EventEmitter();
}
@Component({
selector: 'parent-dumb-component',
template: `
<child-dumb-component></child-dumb-component>
<child-dumb-component></child-dumb-component>
`
})
export class ParentDumbComponent {
@Output()
@ObserveChildren(ChildDumbComponent, 'customEvent') childEvents;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment