I am making a list using "ng-repeat" loop , and want to use id the attribute to set the ng-include as per selected from the list but don't know how to do that.. plz help..thank u...
.state('app.c.ctopic-det', {
url: "/ctopic-det/{{chat.id}}",
views: {
'tab-ctopic': {
templateUrl: 'tech/chat-detail.html',
controller: 'ChatDetailCtrl'
}
}
})
<ion-view view-title="C Language">
<ion-content >
<div class="list list-inset">
<a class="item item-icon-right" ng-repeat="chat in chats" href="#/app/c/ctopic-det/{{chat.id}}">
{{chat.title}}
<i class="icon ion-ios-arrow-right"></i>
</a>
</div>
</ion-content>
</ion-view>
If I really understand your question, you need to wrap your link tag into a div and apply your ng-repeat on this last one like that :
<ion-view view-title="C Language">
<ion-content >
<div class="list list-inset">
<div ng-repeat="chat in chats">
<a class="item item-icon-right" href="#/app/c/ctopic-det/{{chat.id}}">
{{chat.title}}
<i class="icon ion-ios-arrow-right"></i>
</a>
</div>
</div>
</ion-content>
</ion-view>
The variable set in ng-repeat is only available in the child scope and not in the current scope.