Skip to content

Instantly share code, notes, and snippets.

@bbachi
Last active January 13, 2021 20:38
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save bbachi/f7f8fb99c3f83ace1a728904556d7b91 to your computer and use it in GitHub Desktop.
Save bbachi/f7f8fb99c3f83ace1a728904556d7b91 to your computer and use it in GitHub Desktop.
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