要使用Angular调用函数来更改按钮类的CSS颜色,可以按照以下步骤进行:
Click me
.myButton { background-color: red; color: white; }
isButtonClicked: boolean = false;
changeButtonColor() { this.isButtonClicked = !this.isButtonClicked; }
这样,当按钮被点击时,按钮类的样式将会改变。
上一篇:Angular调用FirebaseCallableFunctions时出现CORS错误?
下一篇:Angular调用Java服务时出现CORS错误。