i want to create a object such as this
$scope.allBooks = {
books:[
{
name:"",
id:""
}
{
name:"",
id:""
}
// can be add another object
]
books:[
{
name:"",
id:""
}
{
name:"",
id:""
}
]
}
in fact be able to add more object to books and also add more books to allBooks. my solution is this
$scope.allBooks = {};
$scope.allBooks.books= [];
var b= {
name:"",
id:""
};
$scope.allBooks.books.push(b);
my problem is how to add more object to books and also add more array to allBooks?