Click Button to show another button and opposite


I am wanting to have the Resolve Ticket Button showing when the open item is an Incident. When I click Resolve Ticket, I want Cancel and Confirm buttons to show. However, when you click Cancel I need Resolve Ticket to show again. I can get Cancel/Confirm to show, but clicking Cancel does nothing. The HTML is below.

<div class="panel b" ng-if=" == true"> 
         <div class="panel-heading bg-primary"> 
             <div class="panel-title">Is this no longer an issue?</div> 
         <div class="panel-body"> 
        <div ng-if="!"> 
         <a class="btn btn-primary" ng click="c.openConfirmDialog()">Resolve Ticket</a> 
<div ng-if="">
<a class="btn btn-primary" ng-click="!c.openConfirmDialog()">Cancel</a>
<a class="btn btn-primary" ng-click="c.openConfirmDialog()">Confirm</a>

The AngularJS function is

function($location) {
/*widget conotroller */
var c = this; = false
if ($ == 'incident'){ = true 
c.openConfirmDialog = function(){ = true; 


Try this:

<a class="btn btn-primary" ng-click=" = false; = true">Cancel</a>

I’m not sure what you were trying to do with !c.openConfirmDialog() but this will definitely not undo what the function did when it was called before.

Answered By – Titus

Answer Checked By – Senaida (AngularFixing Volunteer)

Leave a Reply

Your email address will not be published.