Angular make button not clickable?
[disabled]=”test!= false” // this makes the button disable but still if I click the buttons takes me to the page normally
[disabled]=”!test” // doesn’t work
ng-disabled=”!test”// doesn’t work .
Anybody who has an idea what am I missing, thank you?
Seemi izaabel
The problem here isn’t the [disabled], your first use of it is fine. The problem is that the router link doesn’t care about the disabled attribute.
Write review
Write review
Rony cortze
@Component({
selector: 'app-primary-button',
template: `
My real button
`
})
export class PrimaryButton {
/**
* Provide an input for the property
* and use it in the template
*/
@Input() disabled = false;
}
Then you’l be able to use your custom button as