Angular 仅为jhipster将网页包服务器热重新加载到浏览器控制台时获取角度错误,而不是在其他编译时获取

Angular 仅为jhipster将网页包服务器热重新加载到浏览器控制台时获取角度错误,而不是在其他编译时获取,angular,webpack,jhipster,webpack-dev-server,Angular,Webpack,Jhipster,Webpack Dev Server,我有一个调试开发设置,根据jHipster指令配置代理Web包服务器和broswersink。服务器端工作正常,静态文件可以很好地从中提取出来,并且可以在localhost:9000和localhost:9060上请求,但在browsersynk下的浏览器选项卡上调用localhost:9000/或localhost:9000/api时,angular应用程序本身就不能。我在浏览器控制台中显示错误,如下所示: Error: Invalid configuration of route 'teac

我有一个调试开发设置,根据jHipster指令配置代理Web包服务器和broswersink。服务器端工作正常,静态文件可以很好地从中提取出来,并且可以在
localhost:9000
localhost:9060
上请求,但在browsersynk下的浏览器选项卡上调用
localhost:9000/
localhost:9000/api
时,angular应用程序本身就不能。我在浏览器控制台中显示错误,如下所示:

Error: Invalid configuration of route 'teacher/class/:id'. One of the following must be provided: component, redirectTo, children or loadChildren
    at validateNode (router.js?6580:607)
    at validateConfig (router.js?6580:577)
    at validateNode (router.js?6580:623)
    at validateConfig (router.js?6580:577)
    at Router.resetConfig (router.js?6580:4111)
    at new Router (router.js?6580:3779)
    at setupRouter (router.js?6580:5591)
    at _callFactory (core.js?09c9:18520)
    at _createProviderInstance (core.js?09c9:18466)
    at initNgModule (core.js?09c9:18396)
而且它不指向在同一文件中配置的几乎相同的路由。我不知道这条特定路线出了什么问题

在一个地方,我配置了两条路线,如下所示:

import { Route, Routes } from '@angular/router';

import { CreateKindergartenclassComponent } from 'app/businesslogic';
import { DetailKindergartenclassComponent } from 'app/businesslogic';
import { ListKindergartenclassComponent } from 'app/businesslogic';
import { SelectKindergartenclassComponent } from 'app/businesslogic';
import { UserRouteAccessService } from 'app/core';
import { KindergartenClassResolve } from 'app/entities/kindergarten-class';
import { CommentResolve } from 'app/entities/comment';

export const createKindergartenclassRoute: Route = {
  path: 'teacher/class/create',
  component: CreateKindergartenclassComponent,
  data: {
    authorities: ['ROLE_TEACHER_PAID'],
    pageTitle: 'businesslogic.create.kindergartenclass.title'
  },
  canActivate: [UserRouteAccessService]
};

export const detailKindergartenclassRouteChild: Route = {
  path: 'child/class/:id',
  component: DetailKindergartenclassComponent,
  data: {
    authorities: ['ROLE_CHILD_PAID'],
    pageTitle: 'businesslogic.kindergartenclass.title'
  },
  resolve: {
    kindergartenClass: KindergartenClassResolve
  },
  canActivate: [UserRouteAccessService]
};

export const detailKindergartenclassRouteTeacher: Route = {
  path: 'teacher/class/:id',
  component: DetailKindergartenclassComponent,
  data: {
    authorities: ['ROLE_TEACHER_PAID'],
    pageTitle: 'businesslogic.kindergartenclass.title'
  },
  resolve: {
    kindergartenClass: KindergartenClassResolve
  },
  canActivate: [UserRouteAccessService]
};

export const listKindergartenclassRoute: Route = {
  path: 'teacher/classes',
  component: ListKindergartenclassComponent,
  data: {
    authorities: ['ROLE_TEACHER_PAID'],
    pageTitle: 'businesslogic.list.kindergartenclass.title'
  },
  resolve: {
    kindergartenClass: KindergartenClassResolve
  },
  canActivate: [UserRouteAccessService]
};

export const listKindergartenclassRouteChild: Route = {
  path: 'child/classes',
  component: ListKindergartenclassComponent,
  data: {
    authorities: ['ROLE_CHILD_PAID'],
    pageTitle: 'businesslogic.list.kindergartenclass.title'
  },
  resolve: {
    kindergartenClass: KindergartenClassResolve
  },
  canActivate: [UserRouteAccessService]
};

export const selectKindergartenclassRoute: Route = {
  path: 'child/select',
  component: SelectKindergartenclassComponent,
  data: {
    authorities: ['ROLE_CHILD_PAID'],
    pageTitle: 'businesslogic.list.kindergartenclass.title'
  },
  resolve: {
    kindergartenClass: KindergartenClassResolve
  },
  canActivate: [UserRouteAccessService]
};

export const listKindergartenclassCommentPopupRoute: Route = {
  path: 'teacher/classes/:id/delete',
  component: ListKindergartenclassComponent,
  resolve: {
    comment: CommentResolve
  },
  data: {
    authorities: ['ROLE_USER', 'ROLE_TEACHER_PAID'],
    pageTitle: 'mentalApp.comment.home.title'
  },
  canActivate: [UserRouteAccessService]
};

export const listKindergartenclassCommentPopupRouteChild: Route = {
  path: 'child/classes/:id/delete',
  component: ListKindergartenclassComponent,
  resolve: {
    comment: CommentResolve
  },
  data: {
    authorities: ['ROLE_USER', 'ROLE_CHILD_PAID'],
    pageTitle: 'mentalApp.comment.home.title'
  },
  canActivate: [UserRouteAccessService]
};

我还不清楚原因,但在我将大型
*.route.ts
代码分解成多个代码后,所有内容都开始在browsersync中工作:

import { Route, Routes } from '@angular/router';

import {
  CreateKindergartenclassComponent,
  DetailKindergartenclassComponent,
  ListKindergartenclassComponent,
  SelectKindergartenclassComponent
} from 'app/businesslogic';
import { UserRouteAccessService } from 'app/core';
import { KindergartenClassResolve } from 'app/entities/kindergarten-class';
import { CommentResolve } from 'app/entities/comment';

export const createKindergartenclassRoute: Route = {
  path: 'teacher/class/create',
  component: CreateKindergartenclassComponent,
  data: {
    authorities: ['ROLE_TEACHER_PAID'],
    pageTitle: 'businesslogic.create.kindergartenclass.title'
  },
  canActivate: [UserRouteAccessService]
};

对我来说,仍然是有角度的魔法,我仍然不知道是什么特殊的分裂造成了这个把戏

import { Route, Routes } from '@angular/router';

import {
  CreateKindergartenclassComponent,
  DetailKindergartenclassComponent,
  ListKindergartenclassComponent,
  SelectKindergartenclassComponent
} from 'app/businesslogic';
import { UserRouteAccessService } from 'app/core';
import { KindergartenClassResolve } from 'app/entities/kindergarten-class';
import { CommentResolve } from 'app/entities/comment';

export const listKindergartenclassCommentPopupRoute: Route = {
  path: 'teacher/classes/:id/delete',
  component: ListKindergartenclassComponent,
  resolve: {
    comment: CommentResolve
  },
  data: {
    authorities: ['ROLE_USER', 'ROLE_TEACHER_PAID'],
    pageTitle: 'mentalApp.comment.home.title'
  },
  canActivate: [UserRouteAccessService]
};

export const listKindergartenclassCommentPopupRouteChild: Route = {
  path: 'child/classes/:id/delete',
  component: ListKindergartenclassComponent,
  resolve: {
    comment: CommentResolve
  },
  data: {
    authorities: ['ROLE_USER', 'ROLE_CHILD_PAID'],
    pageTitle: 'mentalApp.comment.home.title'
  },
  canActivate: [UserRouteAccessService]
};
import { Route, Routes } from '@angular/router';

import {
  CreateKindergartenclassComponent,
  DetailKindergartenclassComponent,
  ListKindergartenclassComponent,
  SelectKindergartenclassComponent
} from 'app/businesslogic';
import { UserRouteAccessService } from 'app/core';
import { KindergartenClassResolve } from 'app/entities/kindergarten-class';
import { CommentResolve } from 'app/entities/comment';

export const detailKindergartenclassRoute: Route = {
  path: 'teacher/class/:id',
  component: DetailKindergartenclassComponent,
  data: {
    authorities: ['ROLE_TEACHER_PAID'],
    pageTitle: 'businesslogic.kindergartenclass.title'
  },
  resolve: {
    kindergartenClass: KindergartenClassResolve
  },
  canActivate: [UserRouteAccessService]
};

export const detailKindergartenclassRouteChild: Route = {
  path: 'child/class/:id',
  component: DetailKindergartenclassComponent,
  data: {
    authorities: ['ROLE_CHILD_PAID'],
    pageTitle: 'businesslogic.kindergartenclass.title'
  },
  resolve: {
    kindergartenClass: KindergartenClassResolve
  },
  canActivate: [UserRouteAccessService]
};
import { Route, Routes } from '@angular/router';

import {
  CreateKindergartenclassComponent,
  DetailKindergartenclassComponent,
  ListKindergartenclassComponent,
  SelectKindergartenclassComponent
} from 'app/businesslogic';
import { UserRouteAccessService } from 'app/core';
import { KindergartenClassResolve } from 'app/entities/kindergarten-class';
import { CommentResolve } from 'app/entities/comment';

export const listKindergartenclassRoute: Route = {
  path: 'teacher/classes',
  component: ListKindergartenclassComponent,
  data: {
    authorities: ['ROLE_TEACHER_PAID'],
    pageTitle: 'businesslogic.list.kindergartenclass.title'
  },
  resolve: {
    kindergartenClass: KindergartenClassResolve
  },
  canActivate: [UserRouteAccessService]
};

export const listKindergartenclassRouteChild: Route = {
  path: 'child/classes',
  component: ListKindergartenclassComponent,
  data: {
    authorities: ['ROLE_CHILD_PAID'],
    pageTitle: 'businesslogic.list.kindergartenclass.title'
  },
  resolve: {
    kindergartenClass: KindergartenClassResolve
  },
  canActivate: [UserRouteAccessService]
};
import { Route, Routes } from '@angular/router';

import {
  CreateKindergartenclassComponent,
  DetailKindergartenclassComponent,
  ListKindergartenclassComponent,
  SelectKindergartenclassComponent
} from 'app/businesslogic';
import { UserRouteAccessService } from 'app/core';
import { KindergartenClassResolve } from 'app/entities/kindergarten-class';
import { CommentResolve } from 'app/entities/comment';

export const selectKindergartenclassRoute: Route = {
  path: 'child/select',
  component: SelectKindergartenclassComponent,
  data: {
    authorities: ['ROLE_CHILD_PAID'],
    pageTitle: 'businesslogic.list.kindergartenclass.title'
  },
  resolve: {
    kindergartenClass: KindergartenClassResolve
  },
  canActivate: [UserRouteAccessService]
};