Exercise 7. installApp ||| - button isn't changing to Uninstall


#1

I am trying to finish this exercise, I have managed to display the button, I have two problems:
1. Is the only a small part of the first button in the row is clickable and the others completely not.
2. Also when clicking on the first button it won't change to Uninstall. I have tried to change the 'if(scope.installed)' condition to 'if(!(scope.installed))' , then I can change it once but can't change it back again.
Thanks


#2

Can you show us your code so we can identify where your problem is?


#3

Now the code is working but only with the 'else if' statement.
This is what I have in appInstall.js

app.directive('installApp', function() {
return {
restrict: 'E',
scope: {},
templateUrl: 'js/directives/installApp.html',
link: function(scope, element, attrs) {
scope.buttonText = "Install",
scope.installed = false,

    scope.download = function() {
      element.toggleClass('btn-active');
      if(!(scope.installed)) {
        scope.buttonText = "Uninstall";
        scope.installed = true;
      }
      else if(scope.installed) {
        scope.buttonText = "Install";
        scope.installed = false;
      };
    };
  }

};
});


#5

Me too , only the first button is working and the others don't :frowning:
But when I click in the first one it turn to Uninstall :smiley:
and this is my code :

app.directive('installApp', function() {
  return {
    restrict : 'E',
    scope:{
  
    },
    templateUrl:'js/directives/installApp.html' ,
    link: function(scope, element, attrs) { 
  scope.buttonText = "Install", 
  scope.installed = false, 
  scope.download = function() {  
    element.toggleClass('btn-active'); 
    if(scope.installed) { 
      scope.buttonText = "Install"; 
      scope.installed = false; 
    } else { 
      scope.buttonText = "Uninstall"; 
      scope.installed = true; 
    } 
   };
}
  };
} );

#6

I had the same problem, I figured it out by turning off my ad block and reloading the page, buttons start working.


#7

Works for me too! Thanks !


#8

I noticed that the problem only happens when the browser is in the 3-spit view. if you size out the browser to full screen its fine. I think it might be a problem with the CSS styling and window resizing, but im not sure. But other than that the code given works


#9

Yes in full screen all buttons are working ! Bien vu !


#10

The last button still doesn't work for me even in full-screen mode.