I need to add 2 empty person
objects to array and after populate it. Chrome complains TypeError: object is not a function at new <anonymous>
. What's wrong?
$scope.person = {
firstName : '',
lastName : '',
dateOfBirth : '',
sex : '',
nationality : ''
};
$scope.persons = [];
$scope.persons.push(new $scope.person); // error
$scope.persons.push(new $scope.person);