-
-
Save uno-de-piera/4ed35ac508346d70bea88fa6e8ee072f to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<input type="text" [(ngModel)]="todo" class="form-control" /> | |
<hr /> | |
<button class="btn btn-primary btn-block" (click)="aFireService.add(todo); todo = ''">AÑADIR TODO</button> | |
<hr /> | |
<div *ngIf="(todos | async); let data"> | |
<table class="table" *ngIf="data.length > 0"> | |
<thead> | |
<tr> | |
<th>ID</th> | |
<th>TODO</th> | |
<th>DELETE</th> | |
</tr> | |
</thead> | |
<tbody> | |
<tr *ngFor="let todo of data"> | |
<td>{{ todo.id }}</td> | |
<td>{{ todo.todo }}</td> | |
<td> | |
<button class="btn btn-danger" (click)="aFireService.remove(todo.id)">DELETE</button> | |
</td> | |
</tr> | |
</tbody> | |
</table> | |
<div *ngIf="data.length === 0" class="alert alert-danger text-center">NO HAY TODOS</div> | |
</div> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment