I just started learning Angular but I'm having the following error:
Can't bind to 'disabled' since it isn't a known property of <button>
.
Searching on internet I just found similar errors but they are related to the fact the that the FormsModule is not imported, that doesn't seem to be my case.
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 { }
What does "Can't bind to 'x' since it isn't a known property of 'y'" mean? link. This error often means that you haven't declared the directive "x" or haven't imported the NgModule to which "x" belongs. Perhaps you declared "x" in an application sub-module but forgot to export it.
Can't bind to 'readOnly' since it isn't a known property of 'ng-select'. If 'ng-select' is an Angular component and it has 'readOnly' input, then verify that it is part of this module. If 'ng-select' is a Web Component then add "CUSTOM_ELEMENTS_SCHEMA" to the '@NgModule.
Try this
<button [disabled]="!Button">Click me</button>
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With