Javascript 离子刷新器无法正确重新加载数据

Javascript 离子刷新器无法正确重新加载数据,javascript,angularjs,json,angularjs-scope,ionic-framework,Javascript,Angularjs,Json,Angularjs Scope,Ionic Framework,我正在创建一个应用程序,它从JSON文件加载数据。当触发onRefresh()函数时,它将从第二个JSON文件加载数据。一切正常,但单击从第二个JSON文件生成的元素不会加载正确的数据 因此,在Refresh()之前使用href=“#/tab/chats/{{item.\u id}}},效果很好,但在之后使用,不会产生任何结果。以下是部分代码: <ion-view view-title="Schedule"> <ion-content ng-controller="Sc

我正在创建一个应用程序,它从JSON文件加载数据。当触发
onRefresh()
函数时,它将从第二个JSON文件加载数据。一切正常,但单击从第二个JSON文件生成的元素不会加载正确的数据

因此,在
Refresh()之前使用
href=“#/tab/chats/{{item.\u id}}}
,效果很好,但在之后使用,不会产生任何结果。以下是部分代码:

<ion-view view-title="Schedule">
    <ion-content ng-controller="ScheduleController">
        <ion-refresher pulling-text="Pull to refresh" on-refresh="doRefresh()"></ion-refresher>
        <ion-list>
            <ion-item ng-repeat="item in schedule.programmeField" class="item item-thumbnail-left" href="#/tab/chats/{{item._id}}">
                <img ng-src="http://###/w200/{{item._photos[0]._id}}.jpg" alt="No Image" class="padding-vertical">
                <p>{{item.startField.slice(8,10) + ":" + item.startField.slice(10,12)}}</p>
                <h2>{{item.titleField[0].valueField}}</h2>
                <p>{{item.descField[0].valueField}}</p>
            </ion-item>
        </ion-list>
    </ion-content>
</ion-view>

{{item.titleField[0].valueField}
{{item.descField[0].valueField}}


嵌套这两个GET调用有什么原因吗?似乎doRefresh方法应该在主控制器闭包中而不是嵌套。你是对的!没有注意到。但它没有解决我的问题。
.controller("ScheduleController", ["$scope", "$http", "$state",   "$stateParams", function ($scope, $http, $state, $stateParams) {
    $http.get('../downloads/bbtv.json').success(function (data) {
        $scope.schedule = data;
        $scope.whichelement = $stateParams.aId;
        console.log($scope.whichelement);
        $scope.doRefresh = function () {
            $http.get('../downloads/bbtv2.json').success(function (data) {
                $scope.schedule = data;                 
                $scope.whichelement = $stateParams.aId;
                $scope.$broadcast("scroll.refreshComplete");
                console.log($scope.whichelement);
            });
        }
    });
}])

.state('tab.chat-detail', {
    url: '/chats/:aId',
    views: {
        'tab-chats': {
            templateUrl: 'templates/detail.html',
            controller: 'ScheduleController'
        }
    }
})
<ion-pane>
    <ion-view>
        <ion-content class="padding" ng-controller="ScheduleController">
            <ion-list class="list-inset">
                <ion-item class="item-text-wrap" ng-repeat="item in schedule.programmeField | filter: { _id: whichelement}">
                    <img ng-src="http://photos.media-press.tv/w200/{{item._photos[0]._id}}.jpg" alt="No Image" class="padding-vertical">
                    <h2>{{item.titleField[0].valueField}}</h2>
                    <p>{{item.descField[0].valueField}}</p>                        
                </ion-item>
            </ion-list>
        </ion-content>
    </ion-view>
</ion-pane>