|
@@ -17,6 +17,9 @@ app.controller('MainController', function ($scope, $http, $timeout, $document) {
|
|
|
$scope.things = [];
|
|
$scope.things = [];
|
|
|
$scope.tags = [];
|
|
$scope.tags = [];
|
|
|
$scope.filter = '';
|
|
$scope.filter = '';
|
|
|
|
|
+ $scope.thingsBusy = true;
|
|
|
|
|
+ $scope.tagsBusy = true;
|
|
|
|
|
+
|
|
|
$scope.addFormData = {
|
|
$scope.addFormData = {
|
|
|
busy: true,
|
|
busy: true,
|
|
|
content: ''
|
|
content: ''
|
|
@@ -117,6 +120,8 @@ app.controller('MainController', function ($scope, $http, $timeout, $document) {
|
|
|
};
|
|
};
|
|
|
|
|
|
|
|
$scope.fetchThings = function () {
|
|
$scope.fetchThings = function () {
|
|
|
|
|
+ $scope.thingsBusy = true;
|
|
|
|
|
+
|
|
|
var url = '/api/things';
|
|
var url = '/api/things';
|
|
|
|
|
|
|
|
if ($scope.filter) {
|
|
if ($scope.filter) {
|
|
@@ -125,16 +130,22 @@ app.controller('MainController', function ($scope, $http, $timeout, $document) {
|
|
|
|
|
|
|
|
$http.get(url, {}).then(function (result) {
|
|
$http.get(url, {}).then(function (result) {
|
|
|
angular.copy(result.data.things, $scope.things);
|
|
angular.copy(result.data.things, $scope.things);
|
|
|
|
|
+ $scope.thingsBusy = false;
|
|
|
}, function (result) {
|
|
}, function (result) {
|
|
|
console.error('error:', result);
|
|
console.error('error:', result);
|
|
|
|
|
+ $scope.thingsBusy = false;
|
|
|
});
|
|
});
|
|
|
};
|
|
};
|
|
|
|
|
|
|
|
$scope.fetchTags = function () {
|
|
$scope.fetchTags = function () {
|
|
|
|
|
+ $scope.tagsBusy = true;
|
|
|
|
|
+
|
|
|
$http.get('/api/tags', {}).then(function (result) {
|
|
$http.get('/api/tags', {}).then(function (result) {
|
|
|
angular.copy(result.data.tags, $scope.tags);
|
|
angular.copy(result.data.tags, $scope.tags);
|
|
|
|
|
+ $scope.tagsBusy = false;
|
|
|
}, function (result) {
|
|
}, function (result) {
|
|
|
console.error('error:', result);
|
|
console.error('error:', result);
|
|
|
|
|
+ $scope.tagsBusy = false;
|
|
|
});
|
|
});
|
|
|
};
|
|
};
|
|
|
|
|
|