The issue is that you are assigning a primitive:
$scope.showMessage = User.isloaded;
showMessage
is assigned to false, it is not "pointing" to the isloaded
property.
What you should probably do is set the User
to be a scope variable, something like:
controllers.DefaultCtrl = function($scope, User)
{
$scope.user = User;
$scope.user.getUser("11111");
}
and then in your html you can do:
<h1>{{user.isloaded ? 'success' : 'Loading...'}}</h1>