我正在构建简单的角度应用程序。有学生和教师两个模块。这是我的项目的组织方式。
首先,当用户输入应用程序时,我让他选择他是老师还是学生。
根据用户的身份,将其重定向到相应的模块。
import {NgModule} from '@angular/core';
import {Routes, RouterModule} from '@angular/router';
import { StudentModule } from './student/student.module';
import { TeacherModule } from './teacher/teacher.module';
import { HomeComponent } from './home/home.component';
const routes: Routes = [
{
path: '',
component: HomeComponent
},
{
path: 'student',
loadChildren: () => StudentModule
},
{
path: 'teacher',
loadChildren: () => TeacherModule
}
];
@NgModule({
imports: [RouterModule.forRoot(routes)],
exports: [RouterModule]
})
export class AppRoutingModule {
}
Run Code Online (Sandbox Code Playgroud)
这是我的app.routing.ts档案。
我的问题是当我重定向到模块时,我想在那些模块中的组件之间进行路由。我应该<router-outlet>在每个模块中添加另一个,还是只能<router-outlet> …

我试图安装 daphne===4.0.0 但我不断收到此错误,
\nERROR: Failed building wheel for twisted-iocpsupport\n\n Building wheels for collected packages: twisted-iocpsupport\n Building wheel for twisted-iocpsupport (pyproject.toml) ... error\n error: subprocess-exited-with-error\n\n \xc3\x97 Building wheel for twisted-iocpsupport (pyproject.toml) did not run successfully.\n \xe2\x94\x82 exit code: 1\n \xe2\x95\xb0\xe2\x94\x80> [5 lines of output]\n running bdist_wheel\n running build\n running build_ext\n building \'twisted_iocpsupport.iocpsupport\' extension\n error: Microsoft Visual C++ 14.0 or greater is required. Get it with "Microsoft C++ Build Tools": https://visualstudio.microsoft.com/visual-cpp-build-tools/\n [end of output]\n\n note: This error originates from a …Run Code Online (Sandbox Code Playgroud) 由于字符串在 Java 中是不可变的,这会创建 3 个对象,还是在内部仅创建一个对象。
在 JVM 中执行将如何发生,它是否取决于 JVM 实现?
class Main{
public static void main(String[] args) throws Exception{
String s = "FirstString" + "SecondString" + "ThirdString";
}
}
Run Code Online (Sandbox Code Playgroud)
如果上面的情况在编译时解决了下面的情况如何工作。
class Main{
public static void main(String[] args) throws Exception{
String s = "FirstString" + "SecondString" + args[0];
}
}
Run Code Online (Sandbox Code Playgroud)