1

I am new to angularjs. I was trying the following code:

<html>
<body>
    <script src='angular.min.js'> </script>
    <div ng-app>
        <span ng-controller="textController">{{greetMessage}}</span>
    </div>      

    <script>
        function textController($scope) {
            $scope.greetMessage = 'Happy New Year!';
        }
    </script>

</body>

but it prints nothing. What error am I committing?

1 Answers1

1

Do you have angular.min.js file in the same directory as your html file. If no, then do this remove the line and replace it with <script src="https://ajax.googleapis.com/ajax/libs/angularjs/1.2.29/angular.min.js"></script>

Hope it helps!!