考虑到以下Ionic3项目结构,我需要深层链接以正确反映当前的" breadcrumb"在网址中。
主要问题:必须我有src/pages/journal/add-entry/add-entry.module.ts
个文件?或者src/pages/journal/journal.module.ts
可以将子文件夹中的所有@IonicPages以及它自己的journal.ts组件集中在一起,如下面的代码片段所示?
journal.module.ts
import { NgModule } from '@angular/core';
import { IonicPageModule } from 'ionic-angular';
import { JournalPage } from './journal';
import {AddEntry} from "./add-entry/add-entry";
@NgModule({
declarations: [
JournalPage,
AddEntry
],
imports: [
IonicPageModule.forChild(JournalPage),
IonicPageModule.forChild(AddEntry),
],
exports: [
JournalPage,
AddEntry
]
})
export class JournalModule {}
journal.ts
import { Component } from '@angular/core';
import { IonicPage, NavController, NavParams } from 'ionic-angular';
@IonicPage()
@Component({
selector: 'page-journal',
templateUrl: 'journal.html',
})
export class JournalPage {}
添加-entry.ts
import { Component } from "@angular/core";
import { IonicPage } from "ionic-angular";
@IonicPage()
@Component({
selector: "page-add-entry",
templateUrl: "add-entry.html"
})
export class AddEntry{}