Skip to content

Instantly share code, notes, and snippets.

@samarthagarwal
Created September 3, 2018 10:50
Show Gist options
  • Save samarthagarwal/ac284ef79ec5f0c41f8fe6d9ff4a67aa to your computer and use it in GitHub Desktop.
Save samarthagarwal/ac284ef79ec5f0c41f8fe6d9ff4a67aa to your computer and use it in GitHub Desktop.
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() {
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment