Navigation Menu

Skip to content

Instantly share code, notes, and snippets.

@mmetting
Created June 21, 2017 15:50
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save mmetting/1a8a0faec5316bea5f741c040c0ca668 to your computer and use it in GitHub Desktop.
Save mmetting/1a8a0faec5316bea5f741c040c0ca668 to your computer and use it in GitHub Desktop.
Add another client side button to list all DB entries (Client App)
$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