我在 Angular 中遇到了这个恼人的问题:我通过添加到provides页面的 来覆盖步进器图标:
provide: STEPPER_GLOBAL_OPTIONS, useValue: {displayDefaultIndicatorType: false, showError: true}
Run Code Online (Sandbox Code Playgroud)
这是 HTML 页面(只是一部分,有 7 个元素复制/粘贴):
<mat-horizontal-stepper>
<!-- AREA -->
<mat-step label="Step 1" state="area">
<p>Put down your phones</p>
<div>
<button mat-button matStepperNext>Next</button>
</div>
</mat-step>
<!-- QUESTION -->
<mat-step label="Step 2" state="question">
<p>Socialize with each other</p>
<div>
<button mat-button matStepperPrevious>Back</button>
<button mat-button matStepperNext>Next</button>
</div>
</mat-step>
<!-- MODE -->
<mat-step label="Step 3" state="mode">
<p>Socialize with each other</p>
<div>
<button mat-button matStepperPrevious>Back</button>
<button mat-button matStepperNext>Next</button>
</div>
</mat-step>
...
<!-- Icon overrides …Run Code Online (Sandbox Code Playgroud) 我正在尝试在我的项目中实现一个卡片滑块。实际上,我无法弄清楚为什么 ngx-owl-carousel 没有被渲染并给出一个烦人的问题。我一步一步地遵循npm上的指南,并尝试将 Card 示例放入Angular Docs 中。
<owl-carousel
[options]="{items: 3, dots: false, navigation: false}" [items]="professionals"
[carouselClasses]="['owl-theme', 'row', 'sliding']">
<div class="item" *ngFor="let professional of professionals;let i = index">
<mat-card class="example-card">
<mat-card-header>
<div mat-card-avatar class="example-header-image"></div>
<mat-card-title>Shiba Inu</mat-card-title>
<mat-card-subtitle>Dog Breed</mat-card-subtitle>
</mat-card-header>
<img mat-card-image src="https://material.angular.io/assets/img/examples/shiba2.jpg"
alt="Photo of a Shiba Inu">
<mat-card-content>
<p>
The Shiba Inu is the smallest of the six original and distinct spitz breeds of dog from Japan.
A small, agile dog that copes very well with mountainous …Run Code Online (Sandbox Code Playgroud)