0
Good afternoon, I made the following code: http://jsfiddle.net/27du7oaL/5/ . Accessing Jsfiddle, you can see that Angular shows the title that is in the controller, but does not show any data related to the array. How to solve this problem?
HTML
<div ng-app="Series">
<div class="container" ng-controller="SeriesController">
<h1>{{titulo}}</h1>
<form autocomplete="off" ng-submit="adicionaSerie()">
<div class="form-group">
<label for="nome">Nome da serie:</label>
<input type="text" pattern="{1,}" placeholder="Minímo 1 caractere" id="name" ng-model="novaSerie.nome" required>
</div>
<div class="form-group">
<label for="produtora">Produra:</label>
<input type="text" ng-model="novaSerie.produtora">
</div>
<footer><button type="submit">Adicionar serie</button></footer>
</form>
</div>
<ul>
<li ng-repeat="serie in series">
<h3>{{serie.nome}}</h3>
<h3>{{serie.produtora}}</h3>
</li>
</ul>
</div>
Angularjs :
var app = angular.module("Series", []);
app.controller("SeriesController", function($scope){
$scope.titulo = "Adiciona Serie";
$scope.series = [
{
nome: 'Nothing',
produtora: 'Nothing Producers'
}
];
$scope.novaSerie = {};
$scope.adicionaSerie = function() {
var serie = angular.copy($scope.novaSerie);
$scope.artistas.push(serie);
$scope.novaSerie = {};
}
});
Thank you, I went to make a different example about my problem, and I didn’t realize that in it I put off the div, but in the original had put the ng-controller in a global div of the site there had not worked at all, worse that I only came to find out after I was looking at everything right and I realized that I had committed that I had put '; ' in place of ',' in the separation of attributes of an object... but then q corrected it worked.
– Felipe Emerson