简体   繁体   English

Ionic Angular JS $routeProvider 加载离子列表不会滚动

[英]Ionic Angular JS $routeProvider loading ion-list won't scroll

I have an ion-content tag with ng-view which is pulling in partials using a routeProvider.我有一个带有 ng-view 的ion-content标签,它使用 routeProvider 拉入部分。 Each partial is loading a list from an XML API and this is all working flawlessly, except the lists are completely unscrollable.每个部分都从 XML API 加载一个列表,这一切都完美无缺,除了列表是完全不可滚动的。

I've tried using ion-scroll (which works, but when you release, it scrolls back to the top of the list), as well as scroll="true" and overflow-scroll="true" .我试过使用ion-scroll (它有效,但当你释放时,它会滚动回列表的顶部),以及scroll="true"overflow-scroll="true"

Nothing works.什么都行不通。 Here's some code:这是一些代码:

<ion-header-bar class="bar-stable">
    <label class="item-input-wrapper header">
        <i class="icon ion-android-search placeholder-icon"></i>
        <input type="search" placeholder="Search" ng-model="search.$" />
    </label>
</ion-header-bar>
<ion-content class="has-header" data-ng-view overflow-scroll="true"></ion-content>

And here's an example of a partial (They all follow exactly the same structure.)这是部分的示例(它们都遵循完全相同的结构。)

<ion-list>
    <ion-item data-ng-repeat="route in routes | filter:search" data-ng-click="showRoute(route)">{{route._title}}</ion-item>
</ion-list>

Here is the script:这是脚本:

app.config(function ($routeProvider) {
    $routeProvider
        .when('/', {
            templateUrl: 'partials/route-list.html',
            controller: 'RouteListController'
        })
        .when('/route', {
            templateUrl: 'partials/stop-list.html',
            controller: 'StopListController'
        })
        .when('/stop', {
            templateUrl: 'partials/prediction.html',
            controller: 'PredictionController'
        });
    });

Testing on iPhone 4S Simulated.在 iPhone 4S 上模拟测试。 Any advice would be appreciated.任何意见,将不胜感激。

Thanks谢谢

Try putting a div with the ng-view directive inside ion-content尝试在 ion-content 中放置一个带有 ng-view 指令的 div

<ion-content class="has-header">
  <div data-ng-view></div>
</ion-content>

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM