Im now to AngularJs and i've created a test app. I'm using version 1.3.x and i have faced this problem. Here is the code for HtML and JS
var angular.module('ControllerExample', []).controller('SimpleController', SimpleController);
function SimpleController($scope) {
$scope.customers = [
{ name: 'Customer 1', city: 'Gampaha'},
{ name: 'Customer 2', city: 'Negombo'},
{ name: 'Customer 3', city: 'Gampaha'},
{ name: 'Customer 4', city: 'Gampaha'},
{ name: 'Customer 5', city: 'Kadawatha'}
];
}
<!DOCTYPE html>
<html lang="en" ng-app="ControllerExample">
<head>
<meta charset="utf-8">
<title>AngularJS App</title>
<link rel="stylesheet" href="css/style.css" />
</head>
<body>
<div ng-controller="SimpleController">
Customer Name:
<input type="text" ng-model="name" />
<h3>Adding a Simple Controller</h3>
<ul>
<li ng-repeat="cust in customers">{{ cust.name | uppercase }} - {{ cust.city }}</li>
</ul>
</div>
<script type="text/javascript" src="js/script.js"></script>
<script type="text/javascript" src="js/angular.min.js"></script>
</body>
</html>
Expected behavior is that when i run the app it should display the list of customers and when i filter it by entering a name in the textbox it should filter. But it only shows the binding statements. What am i doing wrong here. I've gone through the documentation and used it in my code. Still doesn't work. Thanks in advance.