Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
Getting Started
<div class="display-board">
<h4>Users Created</h4>
<div class="number">
{{userCount}}
</div>
<div class="btn">
<button class="btn btn-warning" (click)="getAllUsers()">Get All Users</button>
</div>
</div>
import { Component, OnInit, Input, Output, EventEmitter } from '@angular/core';
@Component({
selector: 'app-display-board',
templateUrl: './display-board.component.html',
styleUrls: ['./display-board.component.css']
})
export class DisplayBoardComponent implements OnInit {
constructor() { }
@Input() userCount = 0;
@Output() getUsersEvent = new EventEmitter();
ngOnInit(): void {
}
getAllUsers() {
this.getUsersEvent.emit('get all users');
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment