Disable/ Enable components when changing

Asked

Viewed 20 times

0

I have this variable change Record : Boolean;.

in this method ngOnInit(), I check if it’s a change or not

  ngOnInit() {
      this.empresa = new Empresa;
      if(this.routaAtual.snapshot.url.length > 1){
        let id = this.routaAtual.snapshot.url[1].path;
        this.alterarRegistro = true;
      } else {
        this.alterarRegistro = false;
        this.titulo = "Cadastrar banco";
      }
    }

I want some components to be inactive when the variable this.alterarRegister for true.

I couldn’t do it with the option disabled.

How then ?

  • 1

    Inside the component in HTML... [disabled]="! change"

  • can post the html of this component?

No answers

Browser other questions tagged

You are not signed in. Login or sign up in order to post.