hi guys,
I'm trying the other tab when I click on the selected tab.
But I burned my brain 2 time, I tried ng-class, add a new function,
ng-show/hide and other things. :C but it doesn't work..
here is some part of my code :
*HTML *
<ol>
<li ng-repeat="information in champ.infos | filter:search |
orderBy:order:true" ng-controller="TabController as tab">
<div class="champsCore">
<p>
<a href ng-click="tab.setTab(1)">
{{information.champion}}</a>
{{'Classe: ' + information.lane + ' -- Score: ' +
information.score.kills + ' / ' + information.score.mort + ' / ' +
information.score.assistances}}.
</p>
</div>
<div class="notactive" ng-show="tab.isSet(1)">
<p>{{information.title}}</p>
<p>{{information.description}}</p>
</div>
</li>
</ol>
*JS*
app.controller('TabController', function($scope){
this.setTab = function(NewValue){
this.tab = NewValue;
};
this.isSet = function(GivenValue){
return this.tab === GivenValue;
};
});
*JSON*
[{
"champion": "Ashe",
"lane":"Marksam",
"score":{
"kills":19,
"mort":-2,
"assistances":5
},
"title":"Ashe, Archère de Givre"
},
{
"champion": "Graves",
"lane":"Marksam",
"score":{
"kills":12,
"mort":-4,
"assistances":1
},
"title":"Malcolm Graves, the Outlaw"
}]
Any tip, help would be really nice !!
Thanks for your time :) !
--
You received this message because you are subscribed to the Google Groups
"AngularJS" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
To post to this group, send email to [email protected].
Visit this group at http://groups.google.com/group/angular.
For more options, visit https://groups.google.com/d/optout.