Created
June 21, 2017 15:50
-
-
Save mmetting/1a8a0faec5316bea5f741c040c0ca668 to your computer and use it in GitHub Desktop.
Add another client side button to list all DB entries (Client App)
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$scope.list = function () { | |
$scope.listMessage = "Calling Cloud Endpoint"; | |
$scope.listTextClassName = "ion-loading-c"; | |
fhcloud('/hello/list') | |
.then(function (response) { | |
if (response.msg != null && typeof (response.msg) !== 'undefined') { | |
$scope.listMessage = response.msg.msg.list; | |
$scope.listTextClassName = "ion-checkmark-round"; | |
} else { | |
$scope.listMessage = "Error: Expected a message from $fh.cloud."; | |
$scope.listTextClassName = "ion-close-round"; | |
} | |
}) | |
.catch(function (msg, err) { | |
$scope.listMessage = "$fh.cloud failed. Error: " + JSON.stringify(err); | |
$scope.listTextClassName = "ion-close-round"; | |
}); | |
}; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment