I am new to Angular and I use firebase as my backend. I was hoping someone could debug this problem. When I first go to my page www.mywebsite.com/#defaultHash , the data is not loaded into the DOM, this happens after visiting another hash link and returning back.
My controller looks like this:
var fb = new Firebase('https://asdf.firebaseio.com/');
fb.on('value', function(snapshot) {
var data = snapshot.val();
$scope.propertyConfiguration = data.products;
console.log($scope.propertyConfiguration);
console.log("Data retrieved");
});
$scope.saveConfigs = function(){
var setFBref = new Firebase('https://asdf.firebaseio.com/products');
setFBref.update($scope.propertyConfiguration);
console.log("configurations saved!");
};
I have three hash routes: General, Registration, and Home, otherwise .redirectTo is set to Shared. (They all use this controller). Here an error occurs: (all "links" are href = "# hashWhereever")
1) website.com/#Shared . $scope.propertyConfiguration "Data Retrieved". DOM .
2) website.com/#Registration, , DOM .
3) website.com/#Shared, , DOM .
4) website.com/#Shared. DOM .
$scope.data , Angular , DOM ? DOM , .
"" , window.location.hash = "Shared", .
:( )
$scope. $apply() . , , , $scope. Angular " " , , , $scope overqualify?