本文整理汇总了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));
}
示例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")
);
}
示例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");
});
}
示例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");
});
}
示例5: successCallback
this.http.get("data.json").success((data, status) => {
this.log.info(`GetAll Success: ${status}`);
successCallback(data);
}).error(error => {
示例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);
})
示例7:
.catch(() => {
this.$log.info('WeekMenuController: Unable to fetch basket. Create new empty one');
this.basket = this.lBasketService.createEmptyBasket();
});
示例8: handleError
handleError(err: any): void {
this.$log.info(`[${this.name}] handleError`, err);
alert(err);
}
示例9: onDataReceived
onDataReceived(data: ISampleData): void {
this.$log.info(`[${this.name}] onDataReceived`, data);
this.message = data.message;
}