Try to show a list inside a slide-box, there is the html template.
<ion-view view-title="">
<ion-content>
<ion-slide-box on-slide-changed="slideHasChanged($index)">
<ion-slide ng-repeat="result in resultArr">
<ion-list>
<ion-item ng-repeat="content in result.searchResult">
{{content}}
</ion-item>
</ion-list>
</ion-slide>
</ion-slide-box>
</ion-content>
</ion-view>
$scope.resultsArr
is an array, each entry will be shown in a slide. Within the slide, we show a list of content that comes form resultArr[i].searchResult
, which is another array.
Here is the angularjs code:
.controller("searchCtr", function ($scope) {
//list of $scope variables
$scope.resultArrPromise=null;
$scope.resultArr=null;
$scope.headTag=null;
$scope.slideHasChanged=function($index){
console.log($index);
$scope.resultArrP.then(function(resultArr){
$scope.resultArr=resultArr;
};
$scope.resultArrPromise=search("some terms to search");
$scope.slideHasChanged(0);
})
Function search
gets resultArr
from a remote server and wrap it as a promise.
My problem is that the list inside the slidebox does not expand all the way to right of the screen, see the attached screenshot. If I remove the outer slidebox and just show a
list of resultArr[0]
, the list expands. It must be the problem of outer slidebox then but I
can’t figure out how fix the problem.