當前位置: 首頁>>代碼示例>>TypeScript>>正文


TypeScript angularApp.logService.debug方法代碼示例

本文整理匯總了TypeScript中app/main.angularApp.logService.debug方法的典型用法代碼示例。如果您正苦於以下問題:TypeScript angularApp.logService.debug方法的具體用法?TypeScript angularApp.logService.debug怎麽用?TypeScript angularApp.logService.debug使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在app/main.angularApp.logService的用法示例。


在下文中一共展示了angularApp.logService.debug方法的4個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的TypeScript代碼示例。

示例1: login

    public login(loginData: ILoginModel): ng.IPromise<ILoginResponseModel>  {

        angularApp.logService.debug("authentication.service - login ...");

        // eliminar datos de logon si ya se esta logueado
        if (this.AuthenticationData) {
            this.logOut();
        }

        let params: any = {
            grant_type: "password",
            password: loginData.password,
            username: loginData.username
        };

        if (loginData.useRefreshTokens) {
            params.client_id = APP_NAME;
        }

        return this._http({
            data: $.param(params),
            headers: { "Content-Type": "application/x-www-form-urlencoded" },
            method: "POST",
            url: API_BASE_URL + "token"
        })
        .then((resultCallback: ng.IHttpPromiseCallbackArg<any>): ILoginResponseModel => {
            angularApp.logService.debug("authentication.service - login: " + angular.toJson(resultCallback.data));

            let now: Date = new Date();
            let loginResponse: ILoginResponseModel = {
                    lastRequestDateTime: now,
                    loginDateTime: now,
                    refreshToken: loginData.useRefreshTokens ? resultCallback.data.refresh_token : "",
                    token: resultCallback.data.access_token,
                    useRefreshTokens: loginData.useRefreshTokens ? true : false,
                    userName: loginData.username
            };

            this._localStorageService.set(LOCAL_STORAGE_AUTH_KEY, loginResponse);

            this._rootScope.$emit(EVT_LOGIN);

            return loginResponse;
        })
        .catch((reason: any) => {
            angularApp.logService.error("Error: auth.service - login: " + angular.toJson(reason.data));
            this.logOut();
            return this._q.reject(reason);
        });

    }
開發者ID:dgzornoza,項目名稱:angular-typescript-seed,代碼行數:51,代碼來源:authentication.service.ts

示例2: Date

        .then((resultCallback: ng.IHttpPromiseCallbackArg<any>): ILoginResponseModel => {
            angularApp.logService.debug("authentication.service - login: " + angular.toJson(resultCallback.data));

            let now: Date = new Date();
            let loginResponse: ILoginResponseModel = {
                    lastRequestDateTime: now,
                    loginDateTime: now,
                    refreshToken: loginData.useRefreshTokens ? resultCallback.data.refresh_token : "",
                    token: resultCallback.data.access_token,
                    useRefreshTokens: loginData.useRefreshTokens ? true : false,
                    userName: loginData.username
            };

            this._localStorageService.set(LOCAL_STORAGE_AUTH_KEY, loginResponse);

            this._rootScope.$emit(EVT_LOGIN);

            return loginResponse;
        })
開發者ID:dgzornoza,項目名稱:angular-typescript-seed,代碼行數:19,代碼來源:authentication.service.ts

示例3:

 return httpFn.then((result: ng.IHttpPromiseCallbackArg<T>): T => {
     angularApp.logService.debug(`OK: ${url}: ${angular.toJson(result.data)}`);
     return result.data;
 })
開發者ID:dgzornoza,項目名稱:angular-typescript-seed,代碼行數:4,代碼來源:baseHttp.ts

示例4: logOut

    public logOut(): void {
        this._localStorageService.remove(LOCAL_STORAGE_AUTH_KEY);

        this._rootScope.$emit(EVT_LOGOUT);
        angularApp.logService.debug("authentication.service - logOut");
    }
開發者ID:dgzornoza,項目名稱:angular-typescript-seed,代碼行數:6,代碼來源:authentication.service.ts


注:本文中的app/main.angularApp.logService.debug方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。