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


TypeScript ILogService.info方法代碼示例

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


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

示例1: loadMessage

    loadMessage(): void {
        this.$log.info(`[${this.name}] Loading message...`, this);

        this.sampleService
            .getData()
            .then(this.onDataReceived.bind(this))
            .catch(this.handleError.bind(this));
    }
開發者ID:jchandra74,項目名稱:angular1.5-typescript-jspm-starter-kit,代碼行數:8,代碼來源:app.component.ts

示例2:

    $onInit(): void {
        this.$log.info(`[${this.name}] Initializing Controller...`);

        this.loadMessage();

        const myObs$: Observable<number> = Observable
            .from([1,2,3,4,5])
            .map(n => n * 5);

        this.subscription = myObs$.subscribe(
            n => console.log("data", n),
            e => console.error("error", e),
            () => console.log("COMPLETED")
        );
    }
開發者ID:jchandra74,項目名稱:angular1.5-typescript-jspm-starter-kit,代碼行數:15,代碼來源:app.component.ts

示例3: saveData

    saveData(data: any): IHttpPromise<any> {
        this.$log.info(`[${this.name}] Saving data...`);

        let httpPromise: IHttpPromise<any>;

        if (env !== "PRODUCTION") {
            // do something here that is production code...
        } else {
            httpPromise = this.$timeout(DEV_HTTP_SHORT_DELAY_MS)
                .then( _ => this.$http.put("/api/data/blah", angular.toJson(data)));
        }

        return httpPromise
            .then(({data}) => data)
            .catch(err => {
                this.$log.error(err);
                this.$q.reject("Unable to save data");
            });
    }
開發者ID:jchandra74,項目名稱:angular1.5-typescript-jspm-starter-kit,代碼行數:19,代碼來源:sample.service.ts

示例4: getData

    getData(): IHttpPromise<any> {
        this.$log.info(`[${this.name}] Getting data...`);

        let httpPromise: IHttpPromise<any>;

        if (env !== "PRODUCTION") {
            // simulate delay and get sample data
            httpPromise = this.$timeout(DEV_HTTP_LONG_DELAY_MS)
                .then( _ => this.$http.get("/data/sample.data.json"));
        } else {
            // real API Url endpoint here.
            httpPromise = this.$http.get("/api/data/blah");
        }

        return httpPromise
            .then(({data}) => data)
            .catch(err => {
                this.$log.error(err);
                this.$q.reject("Unable to load data");
            });
    }
開發者ID:jchandra74,項目名稱:angular1.5-typescript-jspm-starter-kit,代碼行數:21,代碼來源:sample.service.ts

示例5: successCallback

 this.http.get("data.json").success((data, status) => {
     this.log.info(`GetAll Success: ${status}`);
     successCallback(data);
 }).error(error => {
開發者ID:AmirSasson,項目名稱:Angular1TypescriptSystemJs,代碼行數:4,代碼來源:service-in-module.ts

示例6:

      .catch(() => {
        this.$log.info('BasketController: Unable to fetch basket. Create new empty one');

        this.basket = this.lBasketService.createEmptyBasket();
        this.basket = this.lBasketService.setUserToEachOrderIn(this.basket, this.user);
      })
開發者ID:lunches-platform,項目名稱:fe,代碼行數:6,代碼來源:basket.component.ts

示例7:

      .catch(() => {
        this.$log.info('WeekMenuController: Unable to fetch basket. Create new empty one');

        this.basket = this.lBasketService.createEmptyBasket();
      });
開發者ID:lunches-platform,項目名稱:fe,代碼行數:5,代碼來源:week-menu.component.ts

示例8: handleError

 handleError(err: any): void {
     this.$log.info(`[${this.name}] handleError`, err);
     alert(err);
 }
開發者ID:jchandra74,項目名稱:angular1.5-typescript-jspm-starter-kit,代碼行數:4,代碼來源:app.component.ts

示例9: onDataReceived

 onDataReceived(data: ISampleData): void {
     this.$log.info(`[${this.name}] onDataReceived`, data);
     this.message = data.message;
 }
開發者ID:jchandra74,項目名稱:angular1.5-typescript-jspm-starter-kit,代碼行數:4,代碼來源:app.component.ts


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