samarthagarwal
9/3/2018 - 10:50 AM

IF_05_09_NavigationService_Office_TS

import { Component, OnInit } from '@angular/core';
import { NavController } from '@ionic/angular';
import { NavigationService } from '../navigation.service';

@Component({
  selector: 'app-office',
  templateUrl: './office.page.html',
  styleUrls: ['./office.page.scss'],
})
export class OfficePage implements OnInit {

  name: string;

  constructor(private navCtrl: NavController, private navigationService: NavigationService) { 

    // Getting the value of name from the JSON data sent from the home page
    this.name = this.navigationService.getData().name;

  }

  goBack(){
    this.navCtrl.goBack('/home');
  }

  ngOnInit() {
  }

}