我正在为我的列表页面中的每一行提供额外信息的详细信息页面,但我的详细信息页面无法打开路由器链接。页面不变,url不变,但在网络选项卡中,应用程序称为源地图.js文件。里面是我的整个html、scss、组件、模块和服务代码。
我检查是否在页面模块中添加了RouterModule和页面的路径值。我可以从路由器链接读取的URL也设置了所有的动态值,并且它与路径匹配。
我是不是在我的页面配置中遗漏了一些东西来让它工作?
我使用的是fuse主题模板7.1.0版
这是我的代码片段:
<div class="page-layout blank p-24" fusePerfectScrollbar>
<h1>List Row Detail</h1>
<div class="content pb-24" fxLayoutAlign="start start">
<form class="mat-white-bg mat-elevation-z4 p-24 w-100p" [formGroup]="detailForm">
<div fxLayout="column">
<mat-form-field class="w-350 mr-10 pt-10">
<input matInput placeholder="Name" class="w-350" type="text" formControlName="Name" readonly="readonly" />
</mat-form-field>
</div>
</form>
</div>
</div>
import { Component, OnInit } from '@angular/core';
import { NotificationService } from '../../xxxx/services/notification.service';
import { IdentificationGeneratorService } from '../../xxxx/services/identification-geneterator.service';
import { Notification } from '../../xxxx/models/notification.model';
import { ActivatedRoute } from '@angular/router';
import { FormBuilder } from '@angular/forms';
import { FuseSplashScreenService } from '@fuse/services/splash-screen.service';
@Component({
selector: 'row-list-detail',
templateUrl: './row-list-detail.component.html',
styleUrls: ['./row-list-detail.component.scss'],
})
export class RowListDetailComponent implements OnInit {
organizationGuid;
rowListGuid;
detailForm;
constructor(private notificationService: NotificationService,
private formBuilder: FormBuilder,
private activatedRoute: ActivatedRoute,
private fuseSplashScreenService: FuseSplashScreenService) {
this.fuseSplashScreenService.hide();
this.detailForm = this.formBuilder.group({
Name: [''],
});
this.organizationGuid = this.activatedRoute.snapshot.params['organizationGuid'];
this.rowListGuid = this.activatedRoute.snapshot.params['rowListGuid'];
}
}
import { NgModule } from '@angular/core';
import { RouterModule } from '@angular/router';
import { FuseSharedModule } from '@fuse/shared.module';
import { FormsModule, ReactiveFormsModule } from '@angular/forms';
import { MatFormFieldModule, MatInputModule } from '@angular/material';
import { RowListDetailComponent } from './row-list-detail.component';
import { InformationDialogModule } from '../../xxxx/components/information-dialog/information-dialog.module';
const routes = [
{
path: '**',
component: RowListDetailComponent
}
];
@NgModule({
declarations: [
RowListDetailComponent
],
imports: [
FuseSharedModule,
RouterModule.forChild(routes),
FormsModule,
ReactiveFormsModule,
MatFormFieldModule,
MatInputModule,
InformationDialogModule
],
exports: [
RowListDetailComponent
]
})
export class RowListDetailModule {
}
<div class="page-layout blank p-24" fusePerfectScrollbar>
<h1>List</h1>
<ngx-datatable class="material" [rows]="list" [columnMode]="'force'" [headerHeight]="50" [footerHeight]="50"
[rowHeight]="50" [limit]="20" [sorts]="[{prop: 'Name', dir: 'desc'}]" [cssClasses]="iconsCss">
<ngx-datatable-column prop="Name" name="Name">
<ng-template let-row="row" ngx-datatable-cell-template>
<a [routerLink]="['/Apps/Organizations', organizationGuid , 'Lists', row.rowListGuid, 'Detail']">{{row.Name}} </a>
</ng-template>
</ngx-datatable-column>
</div>
import { NgModule } from '@angular/core';
import { RouterModule } from '@angular/router';
import { FuseSharedModule } from '@fuse/shared.module';
import { MsalGuard } from '@azure/msal-angular';
import { CheckRedirectUrlService } from 'app/xxxx/services/checkredirecturl.service';
const routes = [
{
path: 'Organizations/:organizationGuid/Lists/:rowListGuid/Detail',
loadChildren: './row-list-detail/row-list-detail.module#RowListDetailModule',
canActivate: [MsalGuard, CheckRedirectUrlService]
},
{
path: 'Organizations/:organizationGuid/Lists',
loadChildren: './list/list.module#ListModule',
canActivate: [MsalGuard, CheckRedirectUrlService]
}
];
@NgModule({
imports : [
RouterModule.forChild(routes),
FuseSharedModule
]
})
export class AppsModule
{
}发布于 2020-09-21 21:44:27
问题是textarea元素试图设置我的模型中定义的日期值。更改模型中的值字段后,字符串问题得到了解决,页面加载成功,并设置了表单中包含文本区域的字段。
https://stackoverflow.com/questions/63795330
复制相似问题