本文整理匯總了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;
}