If I have a standard factory, creating a person, say:
$scope.person = Person.get({person: $routeParams.person},function () {
},function (httpResponse) {
});
My HTML is:
<div>Person is: {{person}}</div>
Fairly straightforward. My issue is with rendering. My understanding is that when this runs, it immediately returns an empty object; when the async get
finally returns, it will fill in $scope.person
, and then re-render.
- What prevents this from just rendering as
Person is:
and then rerendering asPerson is: John
? I don't want that blank, if anything, I want to show some "loading" and then change it when render is complete. - How do I handle errors? If I get a 404 - say the person ID is non-existent - I want to show some form of "sorry, the user you requested doesn't exist". But I want to be sure that shows only after I actually tried, not accidentally render it while waiting for the person to load.