This forum is now read-only. Please use our new forums! Go to forums

0 points
over 8 years

install App I of Directives wont work, help please?

I am posting my code as well. The 3rd instruction is to put a 4th option called “link” in “installApp.js” file. I am doing so but nothing happens.

Here is the 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; } } } };
});

Answer 55e5a6ad86f552f01e000498

2 votes

Permalink

I’m also having this problem. After typing the code myself, also tried copy pasting but nothing happened.

Edit: I removed the extra space after link: and it worked.It was link: function before. I changed it to link: function. Only 1 space after link:

points
Submitted by Karhan Küncü
over 8 years

1 comments

Abdul Wahab. M. Shah over 8 years

haha strange but this worked for me too after i removed the extra space. Thanks Mate

Answer 55e66a7195e37811080000ef

1 vote

Permalink

It works after I refresh the whole browser (not the real-time browser on the right hand side).

points
Submitted by tejayson
over 8 years

1 comments

albertovsky over 8 years

THIS is the real solution. Thanks.

Answer 55e59f8d9113cb092d0000c4

0 votes

Permalink

same here :/

points
over 8 years