Here's the issue: when the variable is named 'name', the error 'dupes Duplicate Key in Repeater' appears!
But why does this happen? Here's the code snippet:
app.js
var galleryModule = angular.module ("gallery",[]);
var name = ['Juan Manuel Jimenez','Carlos ALberto','Choko Barrios','Cota','Huevo'];
galleryModule.controller("appController", ["$scope", function($scope) {
$scope.names = name;
}]);
index.html
<!DOCTYPE html>
<html lang="en" ng-app="gallery">
<head>
<title>
GALERIA
</title>
<meta charset="utf-8">
<script src="JS/angular.js"></script>
<script src="JS/app.js"></script>
</head>
<body>
<div class="container" ng-controller="appController">
<div ng-repeat="n in names">
Welcome: {{n}}
</div>
</div>
</body>
</html>
However, if you change 'name' to 'something' in the second line of app.js and within appController as well. The code will function without any issues! That's strange to me.
Update:
I've resolved my problem. I realized that I was using the name variable in the global scope, causing conflicts with the windows.name
So, the solution I opted for was to use a closure like this:
(function() {
var galleryModule = angular.module ("gallery",[]);
var name = ['Juan Manuel Jimenez','Carlos ALberto','Choko Barrios','Cota','Huevo'];
galleryModule.controller("appController", ["$scope", function($scope) {
$scope.names = name;
}]);
})();
Thank you all! :)