modal-one.component.ts
919 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
import { Component, OnDestroy, OnInit } from '@angular/core';
import { SharedServiceService } from '../../services/shared-service.service';
import { Router } from '@angular/router';
import { Subscription } from 'rxjs/Subscription';
@Component({
selector: 'app-modal-one',
templateUrl: './modal-one.component.html',
styleUrls: ['./modal-one.component.css']
})
export class ModalOneComponent implements OnInit, OnDestroy {
title: string;
subscription: Subscription;
constructor(private shared: SharedServiceService, private router: Router) {
this.subscription = shared.title$.subscribe(title => {
this.title = title;
});
}
ngOnInit() {
}
btnChange() {
this.shared.changedTitle('modal-one');
}
btnNext() {
this.router.navigate(['/wizard', 2]);
}
btnClose() {
this.router.navigate(['/wizard']);
}
ngOnDestroy() {
this.subscription.unsubscribe();
}
}