我想使用延迟加载,但我不明白为什么它不起作用,它给我错误"找不到模块".
这是我的环境:
- Angular 5.2.1
- .NET Core 2
- Webpack 3.10.0
- angular-router-loader 0.8.2
- @ angular/cli 1.6.5
我在loadChildren尝试了不同的路径总是没有成功,我也暂时禁用所有警卫和儿童路线.我做错了什么?
FOLDERS
ClientApp
app
components
users
users-routing.module.ts
users.module.ts
app-routing.module.ts
app.module.shared.ts
Run Code Online (Sandbox Code Playgroud)
APP-routing.module.ts
const appRoutes: Routes = [
{
path: 'users',
loadChildren: './components/users/users.module#UsersModule'/* ,
canLoad: [AuthGuard] */
},
{
path: '',
redirectTo: '/login',
pathMatch: 'full'
},
{
path: '**',
redirectTo: '/login'
}
];
@NgModule({
imports: [
RouterModule.forRoot(
appRoutes,
{ enableTracing: false }
)
],
exports: [
RouterModule
],
providers: [
CanDeactivateGuard
]
}) …
Run Code Online (Sandbox Code Playgroud) 我正在 .Net Core 和 Angular 13 中开发一个应用程序。
我从 dotnet Angular 模板(dotnet new Angular)开始,然后更新了项目。
我正在尝试在 Visual Studio Code 中为 Angular 应用程序设置调试。
问题是调试开始但断点始终未绑定。
我已经尝试了 StackOverflow 中类似帖子中的所有解决方案以及网络上的许多解决方案,但始终没有成功。
希望有人有一些建议。
我的环境:
角度.json
{
"$schema": "./node_modules/@angular/cli/lib/config/schema.json",
"version": 1,
"newProjectRoot": "projects",
"projects": {
"TcPortingJiraToERPWeb": {
"root": "",
"sourceRoot": "src",
"projectType": "application",
"prefix": "app",
"schematics": {},
"architect": {
"build": {
"builder": "@angular-devkit/build-angular:browser",
"options": {
"progress": false,
"outputPath": "dist",
"index": "src/index.html",
"main": "src/main.ts",
"polyfills": "src/polyfills.ts",
"tsConfig": "src/tsconfig.app.json",
"assets": [
"src/favicon.ico",
"src/assets"
],
"styles": [
"node_modules/bootstrap/dist/css/bootstrap.min.css",
"node_modules/bootstrap-icons/font/bootstrap-icons.css",
"node_modules/ngx-toastr/toastr.css",
"src/styles.css" …
Run Code Online (Sandbox Code Playgroud)