<i class="icon-settings"> </i>
loading: boolean = false;
ngOnInit() {
this.loading = true;
this.service.getInfoValute().subscribe(res => {
if (res) {
this.loading = false;
}
});
}
<ng-container *ngIf="!loading">
<div>{{ IMoney | pipe }}</div>
</ng-container>
loading: boolean = false;
data = [];
ngOnInit() {
this.loading = true;
this.service.getAll().subscribe(res => {
this.data = res;
this.loading = false;
});
}
<ng-container *ngIf="loading">
<div class="loader"> </div>
</ng-container>
<ng-container *ngIf="!loading">
//показываем данные
</ng-container>
updateData(persons[], badges[]) {
let res = persons.map(person = > {
let findInBadge = badges.find(f => f.personId == person.personId);
return {
personId: person.personId,
name: person.name
badge: findInBadge.badge
}
})
return res;
}
newArray = [];
ngOnInit() {
this.newArray = this.updateData(this.persons, this.badges);
}
obj = {
action: 'meet'
}
this.new Array = this.PanelControl.filter(f => f.action === obj.action);
let now = moment().format('YYYY.MM.DD');
checkDate(date) {
if (date === now) {
return 'Сегодня'
}
}
<span>{{now === x.date ? 'Сегодня': x.date}}</span>
{
roleId: 1,
roleName: 'Administrator',
permissionToButton: [ 'excell', 'google drive']
}
<div class="buttons">
<div class="button" *ngFor="let btn of obj.permissions" (click)="clickToBtn(btn)">
{{btn}}
</div>
</div>
<dl-date-time-picker (change)="getDate($event)"> </dl-date-time-picker>
date;
getDate(event) {
this.date = event;
}
<input type="text" [(ngModel)]="date"/>
<div class="icon-pen"> </div>
.icon-pen {
color: red;
font-size:30px;
}
-components:
-A component
-B component
-C component
-components:
-A component
-B component
-C component
{ path: 'main', component: HelloComponent },
{ path: 'main/:id', component: HelloComponent },
[routerLink]="['../main', d.id]"