' $ ionicScroll',指令ERROR IN IONIC所需

时间:2015-06-11 11:25:41

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

当我使用ng-repeat时,我做了ng-repeat的简单例子。它工作正常。但是当我使用collection-repeat时它给了我这个错误

  

控制器' $ ionicScroll',指令' collectionRepeat'所要求的,无法找到!

你可以帮我解决这个错误

这是我的我的傻瓜

http://plnkr.co/edit/LjADQj07M4cEpTQP3WzS?p=preview

<html ng-app="ionicApp">

  <head>
    <meta charset="utf-8">
    <meta name="viewport" content="initial-scale=1, maximum-scale=1, user-scalable=no, width=device-width">
    <title>Invoices Grid</title>
    <!--Stylesheets-->
    <link href="//code.ionicframework.com/nightly/css/ionic.css" rel="stylesheet">
    <link href="style.css" rel="stylesheet">
    <!--Scripts-->
    <script src="//code.ionicframework.com/nightly/js/ionic.bundle.js"></script>

    <script src="script.js"></script>

  </head>

  <body ng-controller="a">
  <div class="row" collection-repeat="n in names">
    <div class="col">{{n.name}}</div>
     <div class="col">{{n.lasename}}</div>
  </div>
  </body>
</html>

1 个答案:

答案 0 :(得分:1)

首先发布Google帖子: http://forum.ionicframework.com/t/error-compile-ctreq-controller-ionicscroll-required-by-directive-collectionrepeat-cant-be-found/4879

集合重复需要一个滚动系统。 因此,请使用<ion-content overflow-scroll="true" >

来覆盖您的代码

请参阅更新的plnkr:http://plnkr.co/edit/LuHPy3lbqYBlg35iYuw1?p=preview