如何在angularjs中组织文件?

时间:2017-08-18 02:20:19

标签: javascript html angularjs

我在我的观点中试图这样做 enter image description here

但它是这样的: enter image description here

我只想要10个文件并使新行放入另外10个文件

继承人的观点

md-content.md-whiteframe-1dp
.glyph layout="row"
  div  layout="column" layout-align="center center" ng-repeat="doc in ctrl.documents" style="text-align: center;"
    div
      md-icon.material-icons.md-48 insert_drive_file
      span.step style="padding-left:48;"
        | test

1 个答案:

答案 0 :(得分:0)

使用 ng-repeat-start ng-repeat-end ,您可以实现,这是角度

的工作方式



angular.module('notesApp', [])
     .controller('MainCtrl', ['$scope', function ($scope) {
     $scope.docs = [1, 2, 3,4, 5,6,7,8,9,10,11,12,13,14,15, 16,17,18,19,20];
 }]);

<html lang = "en">
   <head>
     <link href="//netdna.bootstrapcdn.com/bootstrap/3.0.0/css/bootstrap.min.css" rel="stylesheet"> 
     <link rel = "stylesheet"
         href = "https://ajax.googleapis.com/ajax/libs/angular_material/1.0.0/angular-material.min.css">
      <script src = "https://ajax.googleapis.com/ajax/libs/angularjs/1.4.8/angular.min.js"></script>
      
   </head>
   
   <body ng-app = "notesApp" ng-cloak>
     <div ng-controller="MainCtrl">
      
        <div style="display: inline" ng-repeat-start="doc in docs"><i class="glyphicon glyphicon-file"></i>{{doc}}</div>
        <div ng-repeat-end ng-if="($index + 1) % 10 == 0"></div>
     
       </div>
   </body>
</html>
&#13;
&#13;
&#13;