如何以角度水平滚动?

时间:2015-10-20 10:23:02

标签: angularjs angularjs-directive angularjs-scope ionic-framework ionic

你能告诉我如何水平滚动离子+角度。实际上我想在网格视图中显示数据,在每张幻灯片中显示四个项目。 我想在幻灯片中使用,如此网址所示 http://ionicframework.com/docs/api/directive/ionSlideBox/ 如果数组示例中有更多项目,我需要6个6对象。我需要滑动并在另一张幻灯片中插入两个项目

换句话说,如果数组中有更多项目,我需要在每张幻灯片中显示4个或4个项目我需要添加幻灯片,水平滚动这里是我的代码

http://play.ionic.io/app/4a3adb5bb8f1

angular.module('app', ['ionic']).controller('firstContrl', function($scope) {

    $scope.data = [{
        name: " This is a basic jjj   text."

    }, {
        name: " This is a basic Card1  text."

    }, {
        name: " This is a basic Card2  text."

    }, {
        name: " This is a basic Card3  text."

    },
    {
        name: " This is a basic Card4  text."

    },
    {
        name: " This is a basic Card5  text."

    }]

})

2 个答案:

答案 0 :(得分:0)

尝试:

    <ion-scroll direction="x" class="wide-as-needed">

     Your content

    </ion-scroll>

答案 1 :(得分:0)

Angular具有侧边栏组件。

npm install --save ng-sidebar

然后将SidebarModule添加到您的应用模块:

import { SidebarModule } from 'ng-sidebar';

@NgModule({
  declarations: [AppComponent],
  imports: [BrowserModule, SidebarModule.forRoot()],
  bootstrap: [AppComponent],
})
class AppModule {}

然后

您的页面内容应放在具有ng-sidebar-content属性的某个容器中。

<ng-sidebar-container>

      <!-- container-->

</ng-sidebar-container>
相关问题