CreateAppController.js 629 Bytes
Newer Older
lepdou committed
1 2
create_app_module.controller('CreateAppController', ['$scope', '$window', 'toastr', 'AppService', 'AppUtil',
    function ($scope, $window, toastr, AppService, AppUtil) {
3

lepdou committed
4 5
        $scope.create = function () {
            AppService.create('ALL', $scope.app).then(function (result) {
6 7
                toastr.success('添加成功!');
                setInterval(function () {
lepdou committed
8
                    $window.location.href = '/config.html?#appid=' + result.appId;
9 10
                }, 1000);
            }, function (result) {
lepdou committed
11
                toastr.error(AppUtil.errorMsg(result), '添加失败!');
12 13
            });
        };
14

15
    }]);