angular JS 里的filter怎么不起作用?

<!doctype html>
<html>
<head>
<meta charset="utf-8">
<title>AngularJS example2</title>
<style>
   body{
      background-color:#ddf;
      font:16px bold Gotham, "Helvetica Neue", Helvetica, Arial, sans-serif;
   }
   input{
      padding:10px;
   }
   #list-container{
      background-color:white;
      color:#448;
      border-radius:25px;
      border:1px solid black;
      padding:25px;
   }
</style>
<script src="http://cdn.static.runoob.com/libs/angular.js/1.4.6/angular.min.js"></script>
</head>

<body ng-app>
<p>Search Departments:<input type="text" placeholder="Enter search string" ng-model="searchString"></p>
<div ng-init="departments = [
   {name:'Sales', contact:'Marsha Brown'},
   {name:'Support', contact:'Dave Price'},
   {name:'Production', contact:'Grant Wales'},
   {name:'Service', contact:'Sherry Dell'},
   {name:'Administration', contact:'Sally Bennett'},
   {name:'Accounting', contact:'Kim Sutherland'},
   {name:'Shipping', contact:'Sandy Connell'}]">
</div>
<div id="list-container">
   <ul>
      <li ng-repeat="dept in departments | filter: searchString">{{dept.name + "("+ dept.contact +")"}}</li>
   </ul>
</div>
</body>
</html>

慕标8997690
浏览 1615回答 0
0回答
打开App,查看更多内容
随时随地看视频慕课网APP

相关分类

AngularJS