<!DOCTYPE html>
<html lang="pt-br" ng-app="alurapic"> <!-- Importando o módulo principal para a VIEW -->
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width">
<title>Alurapic</title>
<link rel="stylesheet" href="css/bootstrap.min.css">
<link rel="stylesheet" href="css/bootstrap-theme.min.css">
<!-- Importando o AngularJS -->
<script src="js/lib/angular.min.js"></script>
<!-- Importando a página principal que contém o módulo principal -->
<script src="js/main.js"></script>
<!-- Importando o controller de fotos -->
<script src="js/controllers/fotos-controller.js"></script>
</head>
<body ng-controller="FotosController">
<div class="container">
<h1 class="text-center">Alurapic</h1>
<img class="img-responsive center block" src="{{foto.url}}" alt="{{foto.titulo}}">
</div> <!-- fim container -->
</body>
</html>
angular.module('alurapic', []); //Entre os colchetes podem vir outros módulos.
angular.module('alurapic').controller('FotosController', function($scope) {
$scope.foto = {
titulo = 'Leão',
url = 'http://www.fundosanimais.com/Imagens/siameses.jpg'
};
});
Os erros são:
GET file:///C:/Users/Usuario/alurapic/public/%7B%7Bfoto.url%7D%7D 0 () fotos-controller.js:4
Uncaught SyntaxError: Invalid shorthand property initializer angular.js:11655
Error: [ng:areq] http://errors.angularjs.org/1.3.15/ng/areq?p0=FotosController&p1=not%20a%20function%2C%20got%20undefined at angular.js:38 at Rb (angular.js:1587) at sb (angular.js:1597) at angular.js:8470 at angular.js:7638 at r (angular.js:331) at B (angular.js:7625) at g (angular.js:7117) at g (angular.js:7120) at angular.js:6996