controllers.js 784 B

12345678910111213141516171819
  1. starter.controller('AuthUserCtrl', function ($scope, $state, $ionicSlideBoxDelegate, $rootScope, $ionicHistory, $window, showPopup, global, User) {
  2. global.fetch_user().then(function (data) {
  3. $scope.authuser = {"imid": global.user.im_usrid};
  4. $scope.title = global.user.compname;
  5. });
  6. $scope.commit = function () {
  7. showPopup.showLoading(1, '正在提交', false);
  8. User.user("PostUser").save("'" + JSON.stringify($scope.authuser) + "'", function (res) {
  9. console.log(res);
  10. showPopup.hideLoading();
  11. }, function (err) {
  12. if (err.status == 400)
  13. showPopup.PopupWindow(0, err.data.ExceptionMessage, false, 4000);
  14. else
  15. showPopup.hideLoading();
  16. })
  17. }
  18. })