如何在 Angular nebular 中更改卡片状态?
How to change card status in Angular nebular?
我正在尝试使翻转卡片组件在单击按钮后翻转
我尝试了以下但出现此错误
TS2322: Type '{ isFlipped: boolean; }' is not assignable to type 'boolean'.
这是我的代码
翻转-card.component.ts
export class FlipCardComponent implements OnInit { constructor() {}
isFlipped: boolean = false;
ngOnInit(): void {}
login(): void {
console.log('Clicked');
this.isFlipped = true;
}
}
翻转-card.component.html
<nb-flip-card [showToggleButton]="false" [flipped]={isFlipped} >
Hello! Please indicate your name:
<button nbButton fullWidth status="primary" (click)="login()">Let's chat!
A nebula is an interstellar cloud of dust, hydrogen,
helium and other ionized gases.
Originally, nebula was a name for
any diffuse astronomical object,
including galaxies beyond the Milky Way.
我不知道是什么问题,有人可以帮忙吗?
下一个尝试更改模板的代码
nb-flip-card [showToggleButton]="false"
[flipped]=“isFlipped”>
我正在尝试使翻转卡片组件在单击按钮后翻转 我尝试了以下但出现此错误
TS2322: Type '{ isFlipped: boolean; }' is not assignable to type 'boolean'.
这是我的代码 翻转-card.component.ts
export class FlipCardComponent implements OnInit { constructor() {}
isFlipped: boolean = false;
ngOnInit(): void {}
login(): void { console.log('Clicked'); this.isFlipped = true;
} }
翻转-card.component.html
<nb-flip-card [showToggleButton]="false" [flipped]={isFlipped} >
Hello! Please indicate your name:
<button nbButton fullWidth status="primary" (click)="login()">Let's chat! A nebula is an interstellar cloud of dust, hydrogen, helium and other ionized gases. Originally, nebula was a name for any diffuse astronomical object, including galaxies beyond the Milky Way.
我不知道是什么问题,有人可以帮忙吗?
下一个尝试更改模板的代码
nb-flip-card [showToggleButton]="false"
[flipped]=“isFlipped”>