Answers for "angular emit output"

8

angular event emitter

@Output() open: EventEmitter<any> = new EventEmitter();


  toggel() {
  	this.open.emit(null);
  }
Posted by: Guest on March-26-2020
0

angular emit output

content_copy
      
      @Component({
  selector: 'zippy',
  template: `
  <div class="zippy">
    <div (click)="toggle()">Toggle</div>
    <div [hidden]="!visible">
      <ng-content></ng-content>
    </div>
 </div>`})
export class Zippy {
  visible: boolean = true;
  @Output() open: EventEmitter<any> = new EventEmitter();
  @Output() close: EventEmitter<any> = new EventEmitter();

  toggle() {
    this.visible = !this.visible;
    if (this.visible) {
      this.open.emit(null);
    } else {
      this.close.emit(null);
    }
  }
}
Posted by: Guest on December-16-2020
3

emitter angular

<component
  (open)="open($event)"
></component>
Posted by: Guest on May-23-2020

Code answers related to "Javascript"

Browse Popular Code Answers by Language