2013-12-08 55 views
0

我對Angular JS很新穎。剛開始一個小時回來挖掘它。AngularJSFilter無法正常工作

我無法獲得過濾器API在此頁面上工作。我一片空白..

我很抱歉問這麼愚蠢的問題...

jsfiddle.net/khirthane/52hN5/

+0

模式不是模式 更新[小提琴](http://jsfiddle.net/Eu9WE/) – calebboyd

+0

酷,感謝的人.... – Khirthan

回答

0

試試這個:

<html data-ng-app=""> 

<body data-ng-init="customers=[{name:'John Smith', city:'phoenix'},{name:'John gh', city:'phodafghfenix'},{name:'John gjkgukj', city:'jhjhoenix'}]"> 


    Name: <input type="text" data-ng-model="name"/> 


    <ul> 
     <li data-ng-repeat="cust in customers | filter:name">{{ cust.name }} - {{ cust.city }}</li> 
    </ul> 

</body> 
</html> 
0

你剛剛有一個錯字。

data-ng-modal="name" 

應該

data-ng-model="name"