[AngularJS] ng-repeat-start & ng-repeat-end

If you use 'ng-repeat-start' you also should have 'ng-repeat-end'.

And the element tag for ng-repeat-start and ng-repeat-end should be sinblings.

<!DOCTYPE html>
<html>
<head lang="en">
  <meta charset="utf-8">
  <title>Egghead Videos</title>
  <link rel="stylesheet" href="./foundation.min.css">
  <script type="text/javascript" src="./angular.min.js"></script>
  <script type="text/javascript" src="./app.js"></script>  
</head>
<body ng-app="app">
    <div ng-controller="repeatCtrl as repeat">
        <div ng-repeat-start="item in repeat.items">This is start {{item}}</div>
            This is middle content
        <div ng-repeat-end="">This is end: {{item}}</div>
    </div>

</body>
</html>

 

var app = angular.module("app",[]);
app.controller('repeatCtrl',function(){
    this.items = ['one', 'two', 'three'];
});

 

posted @ 2014-08-27 02:18  Zhentiw  阅读(480)  评论(0)    收藏  举报