我有 2 个不同的组件,我在其中使用 Angular - Expansion Panel 进行可扩展的摘要视图。
我能够<mat-expansion-panel>成功集成到单个组件。
我需要帮助,使Component2.html作为母公司Component1.html(中expand-展开请参见下图)
组件 1 应该能够独立展开和折叠以显示数据
组件 2 应该将组件 1 嵌入到自身中,所以当 Component 1 is expanded it can show its data and display remaining Child components
注意- 组件都具有兄弟关系,no parent child或child - parent
组件1.html
<div class="row">
<div class>
<dl class="row property_set" data-property-set-name="data">
<mat-accordion>
<mat-expansion-panel (opened)="doExpand = true"
(closed)="doExpand = false">
<mat-expansion-panel-header>
<mat-panel-title>
<dt class="col-sm-4 record_property">data</dt>
</mat-panel-title>
<mat-panel-description>
<dd class="col-sm-8 record_property_value data_name" id="{{genId(data.name)}}">
<inline-misal-edit …Run Code Online (Sandbox Code Playgroud) 在我的项目中,我使用 AngularLocalStorage来存储文件名类型的记录的值。back我的方法出现以下错误
错误
Type 'string | null' is not assignable to type 'FileName | undefined'.
Type 'null' is not assignable to type 'FileName | undefined'.
Run Code Online (Sandbox Code Playgroud)
我需要帮助来解决这个错误,下面是我的代码
代码
export interface FileName {
fname: number;
sname: number;
Tange: number;
quick: string;
Mark: string;
mine: number;
}
currentName: FileName | undefined = undefined;
previousName: FileName | undefined = undefined;
data(rec: FileName, Mark: HTMLTableDataCellElement) {
const { fname, sname, Tange, record_id, mine } = rec;
const quick = Mark.innerText;
this.name.replaceAndNew({sname, …Run Code Online (Sandbox Code Playgroud)