So I have been working with my custom content detail page. I have tabs on my page for control bar. My page structure :
<ion-view ng-controller="MyController">
<ion-nav-title></ion-nav-title>
<ion-content>
<ion-list>
<ion-item ng-repeat="data in contents">
{{data.test}}
</ion-item>
</ion-list>
</ion-content>
<div class="tabs tabs-icon-only">
<a class="tab-item" ng-click="favorite({{newId}})">
<i class="icon ion-star"></i>
</a>
<a class="tab-item" ng-click="share({{newId}})">
<i class="icon ion-social-facebook"></i>
</a>
<a class="tab-item" ng-click="trash({{newId}})">
<i class="icon ion-trash-a"></i>
</a>
</div>
</ion-view>
I have a parent scope {{newId}}
which has nothing to do with ng-repeat
Now problem is {{newId}}
showing the value inside anywhere in ion-content. Outside of ion-content it’s undefined. For my action/control bar I need that {{newId}}
value outside.
For more understanding my controller here :
.controller('MyController', function ($scope, SOME_OTHER_PLUGIN){
$scope.newId = '11';
$scope.contents = [];
SCOPE_CONTENTS_HERE
$scope.favorite = function(id){
console.log(id);
}
$scope.share = function(id){
console.log(id);
}
$scope.trash = function(id){
console.log(id);
}
})
Any help will be highly appreciated thanks in advance