Why this simple Angular JS does not working? :(

Viewed 16

This is the code. (I know that I must type here so many text to post my question, but please ignore this part in the parenthesis. It is due only to the rules of the site.)

I can not find the reason, but on screen only appears "{{adat}}".

    <!DOCTYPE html>
    <html>
    <head>
        <meta charset="utf-8">
        <meta name="viewport" content="width=device-width, initial-scale=1">
        <title> </title>
        <script src="https://code.angularjs.org/1.8.2/angular.js">
        </script>
    
        <script type="text/javascript">
        function todoc($scope) {
            $scope.adat = "Szia!";
        }
    </script>
    </head>
    
    <body ng-app>
    
        <div ng-controller="todoc">
        <h1> {{adat}} </h1>
        </div>
   
    </body>
</html>
1 Answers

It turned out that this version of Angular works with a newer syntax. For this syntax the appropriate version is 1.0.0

Related