<!DOCTYPE html> <html ng-app="helloWorldApp"> <head> <meta charset="UTF-8"> <title>#1</title> <script src="https://ajax.googleapis.com/ajax/libs/angularjs/1.0.6/angular.min.js"></script> <script type="text/javascript"> //Создаем модель var model = "Hello, world" //Создаем модуль var helloWorldApp = angular.module ("helloWorldApp", []); //Добавляем контроллер helloWorldApp.controller = ("HelloWorldCtrl", function ($scope) { //Метод создающий контроллер $scope.message = model; //Передаем данные для представления }); </script> </head> <body ng-controller="HelloWorldCtrl"> <h1>{{message}}</h1> <!--Выводим Hello, world --> </body> </html> 

    1 answer 1

    controller is a function.

    Change to

     helloWorldApp.controller("HelloWorldCtrl", function ($scope) { 

    In addition, you should use the latest versions of the framework. Version 1.0.6 is very outdated and has many differences from the latest versions.

    • It worked, thank you! - Bybnovskiy