3
私はちょうど角度を学習し始めましたが、次のエラーがあります: 'disabled'にバインドできません '既知の特性は<button>
である。 インターネットで検索したところ、似たようなエラーが見つかりましたが、FormsModuleがインポートされていないという事実に関連しています。'<button>'の既知のプロパティではないため 'disabled'にバインドできません
app.components.ts
import { Component } from '@angular/core';
@Component({
selector: 'app-root',
templateUrl: './app.component.html',
styleUrls: ['./app.component.css']
})
export class AppComponent {
title = 'app';
Button = false;
}
app.component.html
<div style="text-align:center">
<h1>
Welcome to {{title}}!!
</h1>
<button [Disabled]="!Button">Click me</button>
</div>
app.module.ts
import { BrowserModule } from '@angular/platform-browser';
import { NgModule } from '@angular/core';
import { FormsModule } from '@angular/forms';
import { AppComponent } from './app.component';
@NgModule({
declarations: [
AppComponent,
],
imports: [
BrowserModule,
FormsModule,
],
providers: [],
bootstrap: [AppComponent]
})
export class AppModule { }
のように '' Disabled'の利用小文字の<ボタン、[無効] = "!ボタン">あなたは '無効' を活用することはできません ' –
私をクリックしてください。それは「無効にする」必要があります。 – hyrumcoop
ありがとう@Maximus!それは問題だった、私は問題を見つけることを試みていたと信じることができず、それはとてもシンプルだった:( –