使用 Angular 8,在构建应用程序时,我们遇到以下错误:
app/modules/admin-module/pages/editor/editor.component.ts:6:27 - error TS2306:
File ...node_modules/@angular/material/index.d.ts' is not a module.
Run Code Online (Sandbox Code Playgroud) 在我的Angular应用程序中,我有一个组件:
import { MakeService } from './../../services/make.service';
import { Component, OnInit } from '@angular/core';
@Component({
selector: 'app-vehicle-form',
templateUrl: './vehicle-form.component.html',
styleUrls: ['./vehicle-form.component.css']
})
export class VehicleFormComponent implements OnInit {
makes: any[];
vehicle = {};
constructor(private makeService: MakeService) { }
ngOnInit() {
this.makeService.getMakes().subscribe(makes => { this.makes = makes
console.log("MAKES", this.makes);
});
}
onMakeChange(){
console.log("VEHICLE", this.vehicle);
}
}
Run Code Online (Sandbox Code Playgroud)
但在"制造"属性中我有一个错误.我不知道该怎么做...
我在nav.component.html中单独创建了导航栏,如何在某些组件中隐藏导航栏,例如login.component.
nav.component.html
<nav class="navbar navbar-default navbar-fixed-top navClass">
<div class="container-fluid">
<div class="navbar-header">
<button type="button" class="navbar-toggle collapsed"
(click)="toggleState()">
<span class="sr-only">Toggle navigation</span>
<span class="icon-bar"></span>
<span class="icon-bar"></span>
<span class="icon-bar"></span>
</button>
</div>
<div class="collapse navbar-collapse"
[ngClass]="{ 'in': isIn }">
enter code here <ul class="nav navbar-nav">
<li class="active"><a href="#">Home</a></li>
<li><a href="#">about</a></li>
</ul>
</div>
</div>
</nav>
Run Code Online (Sandbox Code Playgroud) 我有 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)