0

This a simple angular controller but isn't working. I cant find any problems with the code. Can you ?

<!DOCTYPE html>
<html>
<head>
<title>AngularJS Controller</title>
</head>
<body>
    <div ng-controller="SimpleController">
        Name:
        <br/>
        <input type="text" ng-model="nameText"/>
        <br/>
        <ul>
        <li ng-repeat="cust in customers | filter:nameText | orderBy : 'name' ">{{ cust.name }} - {{ cust.city }}
        </li>
        </ul>
    </div>


<script src="Scripts/angular.min.js"></script>

<script>
    function SimpleController ($scope){
        $scope.customers = [ 
            { name:'Konstantinos Korovesis', city:'Pikermi' },
            { name:'Akis Manolis', city:'Argos' },
            { name:'Irem Var', city:'Nea Smirni' },
            { name:'Antonis Ralis', city:'Pallini' }
        ];
    }
</script>

</body>
</html>

.................................This is what i see in my browser...................

Name:

[................]

{{ cust.name }} - {{ cust.city }}

1 Answer 1

1

Add ng-app. Angular needs it to specify the root of the document for angular.

<html ng-app>
Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.