typescript IF_05_09_NavigationService_Office_TS

Posted

tags:

篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了typescript 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() {
  }

}

以上是关于typescript IF_05_09_NavigationService_Office_TS的主要内容,如果未能解决你的问题,请参考以下文章

typescript IF_06_05_home.page.ts_3

typescript IF_05_06_NavigationService_TS

typescript IF_05_13_Routing_Tabs.ts

typescript IF_05_12_Popover_Office_TS

typescript IF_05_10_Popover_Home_TS

typescript IF_05_08_Modal_Office_TS