Я занимаюсь формированием AngularJS, и версия, которую использует парень, - 1.0.8, а я использую 1.7.8 angular и хочу обновить это. Кто-нибудь может мне помочь?
Файл: index.html
<!doctype html>
<html ng-app="pessoas">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>Pessoas</title>
</head>
<body>
<div ng-controller="CtrlPessoas">
<h1>Sistemas de gerenciamento de pessoas</h1>
<ng-view></ng-view>
</div>
</body>
<script src="https://ajax.googleapis.com/ajax/libs/angularjs/1.7.8/angular.min.js"></script>
<script src="pessoas.js"></script>
</html>
Файл: listar.html
<h2>Listagem de Pessoas</h2>
<ul>
<li ng-repeat="pessoa in pessoas">
{{pessoa.nome}}, {{pessoa.cidade}}
</li>
</ul>
Файл: pessoas.js
angular
.module('pessoas', [])
.config(function ($routeProvider) {
$routeProvider
.when('/', {
templateUrl: 'listar.html'
});
})
.controller('CtrlPessoas', function ($scope) {
$scope.pessoas = [
{nome: "Maria", cidade: "São Paulo"},
{nome: "Jose", cidade: " Cacem"},
{nome: "Dave", cidade: "Sintra"},
{nome: "Juan", cidade: "Mexico"}
];
});