0

the requirement is: Initially the image will not be display, I have a button, on click of that button the button. the button should hide and display the image next to that. I tried by this switch case, but its not correct way.

http://jsfiddle.net/4ogjkzyb/

code

app.controller('Approve-ass-controller', function($scope) {
$scope.firstbtnapprove=true;
$scope.secondbtnapprove=true;
$scope.thirdbtnapprove=true;
$scope.firstApprove=false;
$scope.secondApprove=false;
$scope.thirdApprove=false;
$scope.showApprove=function(tag){
    switch(tag){
        case  'first':
        $scope.firstApprove=true;
        $scope.firstbtnapprove=false;
        break;
        case 'second':
        $scope.secondApprove=true;
        $scope.secondbtnapprove=false;
        break;
        case 'third':
        $scope.thirdApprove=true;
        $scope.thirdbtnapprove=false;
        break;
     }
    }
  });

So some one help me out in this. Thanks

1
  • 1
    your fiddle is not complete. it does not have a controller, and it does not have a reference to an app module. Commented Feb 16, 2015 at 14:41

1 Answer 1

1

in general form is really simple to do what you want

 <span>
   <button ng-hide="working" ng-click="working=true; somethingElse()">
      Do Some Work
   </button>
   <img src="some/path"  ng-show="working">
 </span>

w/o more details and a working example this should do i

Sign up to request clarification or add additional context in comments.

1 Comment

thats a working example, you just need to replace the "some/path" with your image source and "somethingElse" with with the function you want to execute on click

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.