它似乎正确地在手机上正常工作,但在进行更改时崩溃了几次。然而,当通过npm终端正确安装离子,covoda时,这种ng-repeat似乎不起作用。
我的控制器:
.controller('feedCtrl', function($scope,$rootScope,$ionicHistory,$state,$http) {
$scope.session_id= sessionStorage.getItem('session_id');
var sid = $scope.session_id;
if($scope.session_id == null){
$state.go('login');
}
else {
$http.jsonp('https://m.socialnetwk.com/home/app/feed_load.php?id='+$scope.session_id).then(function(response){
$scope.feeds = response.data;
});
}
})
我的HTML
<ion-view title="Feed" id="page6">
<ion-nav-buttons side="left" class="has-header">
<button class="button button-icon icon No Icon"></button>
</ion-nav-buttons>
<ion-content padding="true" class="has-header">
<div ng-repeat="feed in feeds">
<ion-list id="search-list5">
<ion-item class="item-avatar" id="search-list-item12">
<img ng-src="https://www.socialnetwk.com/media/{{feed.profile_image}}">
<h2>{{feed.firstname}} {{feed.lastname}}</h2>
<p>{{feed.location}}</p>
</ion-item>
</ion-list>
<div style="margin: 0px; line-height: 250px; background-color: rgb(232, 235, 239); text-align: center;">
<img style="width:100%;height:auto;" ng-src="https://www.socialnetwk.com/media/{{feed.media_file_format}}/{{feed.media_post_id}}{{feed.media_author_id}}.{{feed.media_file_format}}" />
</div>
<div class="item item-body" id="search-list-item-container3">
<div id="search-markdown6" class="show-list-numbers-and-dots">
<p style="margin-top:0px;color:#000000;">{{feed.mediatxt}}
</p>
</div>
</div>
</div>
</ion-content>
</ion-view>