This forum is now read-only. Please use our new forums! Go to forums
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
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:
Answer 55e66a7195e37811080000ef
It works after I refresh the whole browser (not the real-time browser on the right hand side).
1 comments
THIS is the real solution. Thanks.
Answer 55e59f8d9113cb092d0000c4
Popular free courses
- Free Course
Learn SQL
In this SQL course, you'll learn how to manage large datasets and analyze real data using the standard data management language.Beginner friendly,4 LessonsLanguage Fluency - Free Course
Learn JavaScript
Learn how to use JavaScript — a powerful and flexible programming language for adding website interactivity.Beginner friendly,11 LessonsLanguage Fluency - Free Course
Learn HTML
Start at the beginning by learning HTML basics — an important foundation for building and editing web pages.Beginner friendly,6 LessonsLanguage Fluency
1 comments
haha strange but this worked for me too after i removed the extra space. Thanks Mate