Affichage du titre des pages dans la navigation
This commit is contained in:
@@ -14,6 +14,7 @@ export class AppComponent implements OnInit {
|
|||||||
}
|
}
|
||||||
|
|
||||||
ngOnInit() {
|
ngOnInit() {
|
||||||
|
this.serviceComm.componentTitle.subscribe(title => this.title = title);
|
||||||
}
|
}
|
||||||
|
|
||||||
toggleMenu() {
|
toggleMenu() {
|
||||||
|
|||||||
@@ -1,6 +1,7 @@
|
|||||||
import { Component, OnInit } from '@angular/core';
|
import { Component, OnInit } from '@angular/core';
|
||||||
import { AircraftResp } from '../../models/aircraft';
|
import { AircraftResp } from '../../models/aircraft';
|
||||||
import { ServiceApi } from '../../services/serviceApi';
|
import { ServiceApi } from '../../services/serviceApi';
|
||||||
|
import { ServiceComm } from '../../services/serviceComm';
|
||||||
|
|
||||||
@Component({
|
@Component({
|
||||||
selector: 'app-list-of-aircrafts',
|
selector: 'app-list-of-aircrafts',
|
||||||
@@ -10,10 +11,11 @@ import { ServiceApi } from '../../services/serviceApi';
|
|||||||
export class ListOfAircraftsComponent implements OnInit {
|
export class ListOfAircraftsComponent implements OnInit {
|
||||||
public listOfAircrafts: Array<AircraftResp> = new Array<AircraftResp>();
|
public listOfAircrafts: Array<AircraftResp> = new Array<AircraftResp>();
|
||||||
|
|
||||||
constructor(private serviceApi: ServiceApi) {
|
constructor(private serviceApi: ServiceApi, private serviceComm: ServiceComm) {
|
||||||
}
|
}
|
||||||
|
|
||||||
ngOnInit() {
|
ngOnInit() {
|
||||||
|
this.serviceComm.updatedComponentTitle('List of aircrafts');
|
||||||
this.getListOfAircrafts();
|
this.getListOfAircrafts();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -1,6 +1,7 @@
|
|||||||
import { Component, OnInit, Injectable } from '@angular/core';
|
import { Component, OnInit, Injectable } from '@angular/core';
|
||||||
import { DropZoneResp } from '../../models/dropzone';
|
import { DropZoneResp } from '../../models/dropzone';
|
||||||
import { ServiceApi } from '../../services/serviceApi';
|
import { ServiceApi } from '../../services/serviceApi';
|
||||||
|
import { ServiceComm } from '../../services/serviceComm';
|
||||||
|
|
||||||
@Component({
|
@Component({
|
||||||
selector: 'app-list-of-dzs',
|
selector: 'app-list-of-dzs',
|
||||||
@@ -12,10 +13,12 @@ import { ServiceApi } from '../../services/serviceApi';
|
|||||||
export class ListOfDzsComponent implements OnInit {
|
export class ListOfDzsComponent implements OnInit {
|
||||||
public listOfDropZones: Array<DropZoneResp> = new Array<DropZoneResp>();
|
public listOfDropZones: Array<DropZoneResp> = new Array<DropZoneResp>();
|
||||||
|
|
||||||
constructor(private serviceApi: ServiceApi) {
|
constructor(private serviceApi: ServiceApi,
|
||||||
|
private serviceComm: ServiceComm) {
|
||||||
}
|
}
|
||||||
|
|
||||||
ngOnInit() {
|
ngOnInit() {
|
||||||
|
this.serviceComm.updatedComponentTitle('List of DZs');
|
||||||
this.getListOfDropZones();
|
this.getListOfDropZones();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -1,6 +1,7 @@
|
|||||||
import { Component, OnInit } from '@angular/core';
|
import { Component, OnInit } from '@angular/core';
|
||||||
import { JumpTypeResp } from '../../models/jumpType';
|
import { JumpTypeResp } from '../../models/jumpType';
|
||||||
import { ServiceApi } from '../../services/serviceApi';
|
import { ServiceApi } from '../../services/serviceApi';
|
||||||
|
import { ServiceComm } from '../../services/serviceComm';
|
||||||
|
|
||||||
@Component({
|
@Component({
|
||||||
selector: 'app-list-of-jump-types',
|
selector: 'app-list-of-jump-types',
|
||||||
@@ -10,10 +11,11 @@ import { ServiceApi } from '../../services/serviceApi';
|
|||||||
export class ListOfJumpTypesComponent implements OnInit {
|
export class ListOfJumpTypesComponent implements OnInit {
|
||||||
public listOfJumpTypes: Array<JumpTypeResp> = new Array<JumpTypeResp>();
|
public listOfJumpTypes: Array<JumpTypeResp> = new Array<JumpTypeResp>();
|
||||||
|
|
||||||
constructor(private serviceApi: ServiceApi) {
|
constructor(private serviceApi: ServiceApi, private serviceComm: ServiceComm) {
|
||||||
}
|
}
|
||||||
|
|
||||||
ngOnInit() {
|
ngOnInit() {
|
||||||
|
this.serviceComm.updatedComponentTitle('List of jump types');
|
||||||
this.getListOfJumpTypes();
|
this.getListOfJumpTypes();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -2,6 +2,8 @@ import { Component, OnInit } from '@angular/core';
|
|||||||
import { Observable } from 'rxjs/Observable';
|
import { Observable } from 'rxjs/Observable';
|
||||||
import { JumpResp } from '../../models/jump';
|
import { JumpResp } from '../../models/jump';
|
||||||
import { ServiceApi } from '../../services/serviceApi';
|
import { ServiceApi } from '../../services/serviceApi';
|
||||||
|
import { ServiceComm } from '../../services/serviceComm';
|
||||||
|
|
||||||
|
|
||||||
@Component({
|
@Component({
|
||||||
selector: 'app-list-of-jumps',
|
selector: 'app-list-of-jumps',
|
||||||
@@ -11,10 +13,11 @@ import { ServiceApi } from '../../services/serviceApi';
|
|||||||
export class ListOfJumpsComponent implements OnInit {
|
export class ListOfJumpsComponent implements OnInit {
|
||||||
public listOfJumps: Observable<Array<JumpResp>>;
|
public listOfJumps: Observable<Array<JumpResp>>;
|
||||||
|
|
||||||
constructor(private serviceApi: ServiceApi) {
|
constructor(private serviceApi: ServiceApi, private serviceComm: ServiceComm) {
|
||||||
}
|
}
|
||||||
|
|
||||||
ngOnInit() {
|
ngOnInit() {
|
||||||
|
this.serviceComm.updatedComponentTitle('List of jumps');
|
||||||
this.getListOfJumps();
|
this.getListOfJumps();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -1,4 +1,5 @@
|
|||||||
import { Component, OnInit } from '@angular/core';
|
import { Component, OnInit } from '@angular/core';
|
||||||
|
import { ServiceComm } from '../../services/serviceComm';
|
||||||
|
|
||||||
@Component({
|
@Component({
|
||||||
selector: 'app-new-jump',
|
selector: 'app-new-jump',
|
||||||
@@ -7,9 +8,10 @@ import { Component, OnInit } from '@angular/core';
|
|||||||
})
|
})
|
||||||
export class NewJumpComponent implements OnInit {
|
export class NewJumpComponent implements OnInit {
|
||||||
|
|
||||||
constructor() { }
|
constructor(private serviceComm: ServiceComm) { }
|
||||||
|
|
||||||
ngOnInit() {
|
ngOnInit() {
|
||||||
|
this.serviceComm.updatedComponentTitle('Add a new jump');
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,4 +1,5 @@
|
|||||||
import { Component, OnInit } from '@angular/core';
|
import { Component, OnInit } from '@angular/core';
|
||||||
|
import { ServiceComm } from '../../services/serviceComm';
|
||||||
|
|
||||||
@Component({
|
@Component({
|
||||||
selector: 'app-summary',
|
selector: 'app-summary',
|
||||||
@@ -7,9 +8,10 @@ import { Component, OnInit } from '@angular/core';
|
|||||||
})
|
})
|
||||||
export class SummaryComponent implements OnInit {
|
export class SummaryComponent implements OnInit {
|
||||||
|
|
||||||
constructor() { }
|
constructor(private serviceComm: ServiceComm) { }
|
||||||
|
|
||||||
ngOnInit() {
|
ngOnInit() {
|
||||||
|
this.serviceComm.updatedComponentTitle('Summary');
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,6 +1,14 @@
|
|||||||
import { Injectable } from '@angular/core';
|
import { Injectable } from '@angular/core';
|
||||||
|
import { BehaviorSubject } from 'rxjs/BehaviorSubject';
|
||||||
|
|
||||||
@Injectable()
|
@Injectable()
|
||||||
export class ServiceComm {
|
export class ServiceComm {
|
||||||
|
private componentTitleSource = new BehaviorSubject<string>("");
|
||||||
|
componentTitle = this.componentTitleSource.asObservable();
|
||||||
|
|
||||||
constructor() { }
|
constructor() { }
|
||||||
|
|
||||||
|
updatedComponentTitle(title: string) {
|
||||||
|
this.componentTitleSource.next(title);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user