mirror of
https://code.equilibrium.co.ao/ITO/doneit-web.git
synced 2026-04-19 21:06:06 +00:00
Added badge at tabBar
This commit is contained in:
@@ -2,6 +2,7 @@
|
||||
<ion-tab-bar slot="bottom">
|
||||
<ion-tab-button tab="events">
|
||||
<ion-icon name="home"></ion-icon>
|
||||
<ion-badge color="danger">{{totalEvent}}</ion-badge>
|
||||
<ion-label>Home</ion-label>
|
||||
</ion-tab-button>
|
||||
|
||||
@@ -11,6 +12,7 @@
|
||||
</ion-tab-button>
|
||||
<ion-tab-button tab="gabinete-digital">
|
||||
<ion-icon name="file-tray-stacked"></ion-icon>
|
||||
<ion-badge color="danger">{{totalExpediente}}</ion-badge>
|
||||
<ion-label>Gabinete Digital</ion-label>
|
||||
</ion-tab-button>
|
||||
<!-- <ion-tab-button tab="search">
|
||||
|
||||
@@ -1,4 +1,7 @@
|
||||
import { Component, OnInit } from '@angular/core';
|
||||
import { EventsService } from '../services/events.service';
|
||||
import { formatDate } from '@angular/common';
|
||||
import { Event } from '../models/event.model';
|
||||
|
||||
@Component({
|
||||
selector: 'app-home',
|
||||
@@ -6,10 +9,27 @@ import { Component, OnInit } from '@angular/core';
|
||||
styleUrls: ['./home.page.scss'],
|
||||
})
|
||||
export class HomePage implements OnInit {
|
||||
eventsList: Event[];
|
||||
totalEvent=0;
|
||||
totalExpediente=2;
|
||||
|
||||
constructor() { }
|
||||
constructor(private eventService: EventsService) { }
|
||||
|
||||
ngOnInit() {
|
||||
this.eventService.getAllEvents(formatDate(new Date(), 'yyyy-MM-dd', 'pt') + ' 00:00:00', formatDate(new Date(), 'yyyy-MM-dd', 'pt') + ' 23:59:59')
|
||||
.subscribe(response => {
|
||||
this.eventsList = response;
|
||||
this.totalEvent = this.eventsList.length;
|
||||
}
|
||||
);
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
}
|
||||
|
||||
@@ -28,4 +28,7 @@
|
||||
} */
|
||||
.span-color{
|
||||
color:red;
|
||||
}
|
||||
}
|
||||
/* .ion-badge{
|
||||
background: red;
|
||||
} */
|
||||
Reference in New Issue
Block a user