Here is a code snippet that is working. The question is why can we still use this.review inside the addReview function? It may seem incorrect to reference this.review within the addReview function, as the this variable should typically refer to the addReview function itself and not its parent function. Please correct me if I am mistaken.
app.controller('ReviewCtrl',function() {
this.review= {};
this.addReview = function(product) {
product.reviews.push(this.review);
this.review={};
}
});