2013-08-20 2 views
0

다음 코드는 브라우저에서 실행할 때 입력란 만 표시합니다 (Chrome). 그것은 ng-controller 지시어를 사용하려고했을 때 깨진 것 같습니다.다음 코드는 예상대로 수행되지 않습니다. 목록이 렌더링되지 않습니다.

 <!doctype html> 
    <html ng-app=""> 
    <head> 
     <script src="https://ajax.googleapis.com/ajax/libs/angularjs/1.0.6/angular.min.js"> </script> 
    <script> 
     function SController($Scope) { 
     $Scope.customers = 
       [{name:'John Smith',city:'Kingston'}, 
     {name:'Jane Doe',city:'Ocho Rios'}, 
     {name:'Brian Wade',city:'Negril'}, 
     {name:'John Barker',city:'Mandeville'} ]; 
     } 
    </script> 
     </head> 
     <body ng-controller="SController"> 
     <div class="container"> 
      <input type="text" data-ng-model="name"/> 
     <ul> 
     <li ng-repeat="person in customers | filter:name | orderBy:'city'">{{ person.name}} - {{ person.city }} </li> 
     </ul> 
     </div> 
     </body> 
    </html> 
+1

'$ Scope '이 아닌'$ scope'을 사용하십시오. –

답변

1

음, 첫눈에, 당신이 대신 올바른 $scope$Scope을 사용하고있는 것으로 보인다. 해당 발생을 교체하고 다시 시도하십시오.

관련 문제