Blame view

src/app/wizard-base/modal-one/modal-one.component.ts 919 Bytes
522b64d0   Arsisakarn Srilatanart   ทำให้ parent comp...
1
2
3
4
import { Component, OnDestroy, OnInit } from '@angular/core';
import { SharedServiceService } from '../../services/shared-service.service';
import { Router } from '@angular/router';
import { Subscription } from 'rxjs/Subscription';
4fc21097   Arsisakarn Srilatanart   first commit
5
6
7
8
9
10

@Component({
  selector: 'app-modal-one',
  templateUrl: './modal-one.component.html',
  styleUrls: ['./modal-one.component.css']
})
522b64d0   Arsisakarn Srilatanart   ทำให้ parent comp...
11
export class ModalOneComponent implements OnInit, OnDestroy {
4fc21097   Arsisakarn Srilatanart   first commit
12

522b64d0   Arsisakarn Srilatanart   ทำให้ parent comp...
13
14
15
16
17
18
19
20
  title: string;
  subscription: Subscription;

  constructor(private shared: SharedServiceService, private router: Router) {
    this.subscription = shared.title$.subscribe(title => {
      this.title = title;
    });
  }
4fc21097   Arsisakarn Srilatanart   first commit
21
22

  ngOnInit() {
522b64d0   Arsisakarn Srilatanart   ทำให้ parent comp...
23
24
25
26
27

  }

  btnChange() {
    this.shared.changedTitle('modal-one');
4fc21097   Arsisakarn Srilatanart   first commit
28
29
  }

522b64d0   Arsisakarn Srilatanart   ทำให้ parent comp...
30
31
32
33
34
35
36
37
38
39
40
  btnNext() {
    this.router.navigate(['/wizard', 2]);
  }

  btnClose() {
    this.router.navigate(['/wizard']);
  }

  ngOnDestroy() {
    this.subscription.unsubscribe();
  }
4fc21097   Arsisakarn Srilatanart   first commit
41
}