angular event emitter
@Output() open: EventEmitter<any> = new EventEmitter();
toggel() {
this.open.emit(null);
} @Component({
selector : 'child',
template : `
<button (click)="sendNotification()">Notify my parent!</button>
`
})
class Child {
@Output() notifyParent: EventEmitter<any> = new EventEmitter();
sendNotification() {
this.notifyParent.emit('Some value to send to the parent');
}
}
@Component({
selector : 'parent',
template : `
<child (notifyParent)="getNotification($event)"></child>
`
})
class Parent {
getNotification(evt) {
// Do something with the notification (evt) sent by the child!
}
}<component
(open)="open($event)"
></component>
Also in JavaScript:
- react native pm ERR! code EINTEGRITY
- convert nuber into string react js
- javascript pass iterator to callback
- swiftyjson
- update data in json using javascript
- bodyparser express
- how to find id in array javascript
- Cannot find name 'RefObject'
- js fit window to content
- js go to page
- pdfjs customizing viewer.html js event handler
- nativescript vue get native from ref
- check if date equal js
- array destructuring in javascript
- Math.random() javascript
- how to get duplicate values from array in javascript
- js check number of caracters
- js join a list of items with a number
- javascript dictionary
- for loop inside a for loop javascript
- Unexpected end of JSON input while parsing near
- simple node server
- output event angular
- javascript get data-id attribute