I am a javascript noob so i dont understand why in the code below the author uses Avengers.cast instead of just Avengers?
var myApp = angular.module('myApp', []);
myApp.factory('Avengers', function() {
var Avengers = {};
Avengers.cast = [{
name: "Robert Downey Jr.",
character: "Tony Stark / Iron Man"
}];
return Avengers;
})
function AvengersCtrl($scope, Avengers) {
$scope.avengers = Avengers;
}