I'm trying to display a list of products from my firebase database, but the 2 way binding is not working for me. The $scope.products gets updated and prints on the console but is not updated on the UI.
app.controller("productManagerController", ["$scope", function ($scope) {
$scope.products = [];
db.ref("products").once('value').then(function (snapshot) {
const values = snapshot.val()
for (key in values) {
values[key].id = key;
$scope.products.push(values[key])
}
console.log($scope.products) // Logs the values that have been taken from firebase
// But doesn't update on the UI
})
}])