Я только начинаю с AngularJS. Просто попробовал руки с простым фрагментом (ниже). Но я вижу ошибку в консоли браузера.угловой модуль js не может быть загружен
Uncaught Error: [$injector:modulerr] Failed to instantiate module notesApp due to: Error: [$injector:nomod] Module 'notesApp' is not available! You either misspelled the module name or forgot to load it. If registering a module ensure that you specify the dependencies as the second argument.
<html ng-app="notesApp">
<body ng-controller="notesMainCtrl as ctrl">
<form ng-submit="ctrl.submitAction()">
<input type="text"></input>
<input type="password"></input>
<input type="submit"></input>
</form>
<span>username:{{ctrl.username}} password:{{ctrl.password}}</span>
<script src="https://ajax.googleapis.com/ajax/libs/angularjs/1.2.19/angular.js" />
<script type="text/javascript">
angular.module('notesApp',[])
.controller('notesMainCtrl',[function(){
this.username="username";
this.password="password";
this.submitAction=function(){
console.log(this.username+':::'this.password);
};
}]);
</script>
</body>
</html>
это может быть причиной ваш вопрос: 'console.log (this.username + ':::' this.password);' нет '+' между строкой и 'this.password' –
Привет, добро пожаловать к угловым для большей практики, я предлагаю этот проект для получения дополнительной информации [Проект угловых phonecat] (https://docs.angularjs.org/tutorial/step_00) – Maher