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>
'$ Scope '이 아닌'$ scope'을 사용하십시오. –