Pavitra Pavi
Pavitra Pavi

Reputation: 11

How to hide or disable angular button, once user click the button

I am very new to angular I have servicenow experience, I need one help in incident form I have one angular button (Create this incident) once user click the button that button should be hide or read only any code help code :

<div>
  <button class="btn btn-primary" ng-click="$root.trigger()">Create this ticket</button>
  <hr/>
  <h3 class="show-font"><b>OPTIONAL INFORMATION</b></h3>

  <!--<p class="text-muted small">This will help us understand who should be looking into your ticket.</p>-->
</div>

Upvotes: 1

Views: 413

Answers (1)

mr  visual
mr visual

Reputation: 33

Demo

create one variable make it default true;

isShow=true;

give button if condition in element

ng-if="isShow"

when you clickked give click function to html ng-click="test()"

change it

test(){
   this.isShow=!this.isShow;
}

Upvotes: 1

Related Questions