Problem installApp.5/8


#1

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,
          }
        }
      }
        
  };
});

I have passed this exercise, but i have still errors "Missing semicolons"...
And there is no button in the result.
I try everything, i see nothing.

Why ????????


#2

you need to replace the "," with ";" on:

scope.buttonText = "Install",
scope.installed = false,

to:

scope.buttonText = "Install";
scope.installed = false;

that should get rid of the error.


#3

Try this:

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; 
    } 
   };
}
  };
} );

#4

This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.