Ionic 4嵌套路由无效。无法在网址上加载loadchildren

时间:2019-11-29 11:28:26

标签: ionic4 angular-routing angular-router

我有两个页面“项目”和“地址”。现在,我试图在“项目/地址” URL上加载地址页面,但是我仅被重定向到“项目”页面。

这是我在items.module.ts上的路线:

const routes: Routes = [
  {
    path: '',
    component: ItemsPage,
    children :[
      { path: 'address', loadChildren: '../address/address.module#AddressPageModule' },

    ] 
  },

];

我在页面目录中拥有所有页面。 预先感谢

1 个答案:

答案 0 :(得分:1)

问题是未为您的网址from django.contrib.auth.models import AbstractUser from django.db import models import pytz # class MusicGroup(models.Model): # name = models.CharField(max_length=70) from users.models import CustomUser class StudioMeetingNote(models.Model): chairman = models.ForeignKey(CustomUser, on_delete=models.DO_NOTHING, related_name='chairman', verbose_name='Voorzitter') secretary = models.ForeignKey(CustomUser, on_delete=models.DO_NOTHING, related_name='secretary', verbose_name='Notulist') attending_persons = models.ManyToManyField(CustomUser, related_name='attending_persons', verbose_name='Aanwezig') absent_persons = models.ManyToManyField(CustomUser, related_name='absent_persons', verbose_name='Afwezig', blank=True) meeting_start_time = models.DateTimeField('Start tijd') meeting_end_time = models.DateTimeField('Eind tijd') def __str__(self): return str(self.meeting_start_time .astimezone(pytz.timezone('CET')) .date()) class Meta: verbose_name = verbose_name_plural = 'Studio overleg notitie' # def __str__(self): # return 'Studio overleg notitie' class ActionListPoint(models.Model): studio_meeting = models.ForeignKey(StudioMeetingNote, on_delete=models.DO_NOTHING, related_name='studio_meeting_action_list', verbose_name='Studio overleg') who = models.ForeignKey(CustomUser, on_delete=models.DO_NOTHING, related_name='who', verbose_name='Wie') what = models.CharField(max_length=100, verbose_name='Wat', blank=True) when = models.CharField(max_length=50, verbose_name='Wanneer', blank=True) status = models.CharField(max_length=50, verbose_name='Status', blank=True) class Meta: verbose_name = verbose_name_plural = 'Actie punten lijst' class OpeningAndParticularities(models.Model): studio_meeting = models.ForeignKey(StudioMeetingNote, on_delete=models.DO_NOTHING, related_name='studio_meeting_opening_particularities', verbose_name='Studio overleg') added_by = models.ForeignKey(CustomUser, on_delete=models.DO_NOTHING, related_name='added_by_p_and_p', verbose_name='Toegevoegd door') content = models.CharField(max_length=150000, verbose_name="Inhoud") class Meta: verbose_name = verbose_name_plural = 'Opening en bijzondheden' class RemarksPriorMeeting(models.Model): studio_meeting = models.ForeignKey(StudioMeetingNote, on_delete=models.DO_NOTHING, related_name='studio_meeting_remarks_prior_meeting', verbose_name='Studio overleg') added_by = models.ForeignKey(CustomUser, on_delete=models.DO_NOTHING, related_name='added_by_remarks_prior', verbose_name='Toegevoegd door') content = models.CharField(max_length=150000, verbose_name="Inhoud") class Meta: verbose_name = verbose_name_plural = 'Opmerkingen over vorige notulen' class IssuesToAddress(models.Model): studio_meeting = models.ForeignKey(StudioMeetingNote, on_delete=models.DO_NOTHING, related_name='studio_meeting_issues_to_address', verbose_name='Studio overleg') added_by = models.ForeignKey(CustomUser, on_delete=models.DO_NOTHING, related_name='added_by_issues_to_address', verbose_name='Toegevoegd door') content = models.CharField(max_length=150000, verbose_name="Inhoud") class Meta: verbose_name = verbose_name_plural = 'Binnengekomen punten' class OurNextMove(models.Model): studio_meeting = models.ForeignKey(StudioMeetingNote, on_delete=models.DO_NOTHING, related_name='studio_meeting_our_next_move', verbose_name='Studio overleg') added_by = models.ForeignKey(CustomUser, on_delete=models.DO_NOTHING, related_name='added_by_our_next_move', verbose_name='Toegevoegd door') content = models.CharField(max_length=150000, verbose_name="Inhoud") class Meta: verbose_name = verbose_name_plural = 'Wij zijn aan zet' class QuestionRound(models.Model): studio_meeting = models.ForeignKey(StudioMeetingNote, on_delete=models.DO_NOTHING, related_name='studio_meeting_question_round', verbose_name='Studio overleg') added_by = models.ForeignKey(CustomUser, on_delete=models.DO_NOTHING, related_name='added_by_question_round', verbose_name='Toegevoegd door') content = models.CharField(max_length=150000, verbose_name="Inhoud") class Meta: verbose_name = verbose_name_plural = 'Rondvraag' 定义路径'items'。这就是我的做法-

'items/address'