83577a7d5d
removed amber files. replacing with angular removed queue package in favor or worker package removed channel package in favor of pubsub package
38 lines
No EOL
919 B
JavaScript
38 lines
No EOL
919 B
JavaScript
'use strict';
|
|
|
|
angular.module('app').controller("UserController", function($scope, $http, user) {
|
|
|
|
$scope.user = user;
|
|
|
|
// get the user details
|
|
$http({method: 'GET', url: '/v1/user'}).
|
|
success(function(data, status, headers, config) {
|
|
$scope.user = data;
|
|
$scope.userTemp = {
|
|
email : $scope.user.email,
|
|
name : $scope.user.name
|
|
};
|
|
}).
|
|
error(function(data, status, headers, config) {
|
|
console.log(data);
|
|
});
|
|
|
|
$scope.save = function() {
|
|
// request to create a new repository
|
|
$http({method: 'PUT', url: '/v1/user', data: $scope.userTemp }).
|
|
success(function(data, status, headers, config) {
|
|
delete $scope.failure;
|
|
$scope.user = data;
|
|
}).
|
|
error(function(data, status, headers, config) {
|
|
$scope.failure = data;
|
|
});
|
|
};
|
|
$scope.cancel = function() {
|
|
delete $scope.failure;
|
|
$scope.userTemp = {
|
|
email : $scope.user.email,
|
|
name : $scope.user.name
|
|
};
|
|
};
|
|
}); |