File
Implements
Metadata
selector |
app-notification |
styleUrls |
notification.component.scss |
templateUrl |
./notification.component.html |
Methods
ngOnInit
|
ngOnInit()
|
|
Returns: void
|
ngOnDestroy
|
ngOnDestroy()
|
|
Returns: void
|
notiSubs
|
notiSubs: Subscription
|
|
import { Component, OnInit, OnDestroy } from '@angular/core';
import { Observable } from 'rxjs/Observable';
import { Subscription } from 'rxjs/Subscription';
import { HttpService } from '../../../core/services/http';
@Component({
selector: 'app-notification',
templateUrl: './notification.component.html',
styleUrls: ['./notification.component.scss']
})
export class NotificationComponent implements OnInit, OnDestroy {
loading: any;
notiSubs: Subscription;
constructor(private httpInterceptor: HttpService) {
this.notiSubs = this.httpInterceptor.loading.subscribe(
data => this.loading = data
);
}
ngOnInit() {
}
ngOnDestroy() {
// this.notiSubs.unsubscribe();
}
}
<div class="notify-container in" *ngIf="loading.hasError">
<div class="notify-error notify-content">
<div class="notify-error-message">
<span class="notify-icon">!</span>
<p class="notify-icon-text">
{{loading.hasMsg}}
</p>
</div>
</div>
</div>
Legend
Html element with directive