- This topic is empty.
Viewing 3 posts - 1 through 3 (of 3 total)
Viewing 3 posts - 1 through 3 (of 3 total)
- The forum ‘JavaScript’ is closed to new topics and replies.
The forums ran from 2008-2020 and are now closed and viewable here as an archive.
Home › Forums › JavaScript › Angular Directive Problem
Hello friends!
I have the next:
my “game-nav.html” file
my “index.html” file
my “app.js” file
Here, my app.js script code:
<script>
var app = angular.module('store',[]);
app.directive('gameNav',function(){
return {
restrict : 'E',
templateUrl : 'game-nav.html',
controller : function(){
this.tab = 1;
this.selectTab = function(setTab){
this.tab = setTab;
};
this.isSelected = function(chekTab){
return this.tab === chekTab;
}
},
controllerAs : 'panel'
};
});
</script>
In my index.html I have wrote:
<game-nav></game-nav>
I have already added ng-app=”store” to html tag.
When I run the web page the tag doesn’t being interpreted :s just put <game-nav></game-nav> and not the contents file :S
Somebody can help me?
Thanks for your time.
What does your template game-nav.html
looks like?
It appears to be working as far as this following code is concerned, but there could be an issue within your template. Not sure.
Bro, thanks, I don’t know what happened, I just put your code and all are work!! thanks!