当前位置: 首页>>代码示例>>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;未经允许,请勿转载。