Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- private sprintCollection: AngularFirestoreCollection<Sprint>;
- private itemDoc: AngularFirestoreDocument<any>;
- sprints: Sprint[] = [];
- item:any[]=[];
- constructor( private afs: AngularFirestore ) {
- this.sprintCollection = this.afs.collection<Sprint>('Sprints');
- }
- getSprint(value:string){
- this.sprintCollection = this.afs.collection('Sprints', ref => ref.where('Application', '==', value) )
- return this.sprintCollection.valueChanges();
- }
- getSprints(){
- return this.sprintCollection.valueChanges();
- }
- addSprint( sprint:Sprint){
- return this.sprintCollection.add(sprint);
- }
- this._sp.getSprints().subscribe(data=>{
- for(let key$ in data){
- let h =data[key$]
- h.key$ = key$
- this.sprintGrid.push(data[key$]);
- }
- });
- <table class="table table-hover table-sm">
- <thead>
- <tr>
- <th scope="col">Sprint</th>
- <th scope="col">Aplication</th>
- </tr>
- </thead>
- <tbody>
- <tr *ngFor="let sprint of sprintGrid; let i = index">
- <td>{{ sprintGrid[i].Sprint }}</td>
- <td>{{ sprintGrid[i].Application }}</td>
- <td>
- <button kendoButton style="background-color: #ffc107; color:white" class="col-lg-4" [icon]="'edit'" ></button>
- <button kendoButton style="background-color: #dc3545; color:white" (click)="delete(sprintGrid[i].key$)" class="col-lg-4" [icon]="'delete'" ></button>
- </td>
- </tr>
- </tbody>
- </table>
Add Comment
Please, Sign In to add comment