本文整理汇总了TypeScript中@providers/api.ApiService类的典型用法代码示例。如果您正苦于以下问题:TypeScript ApiService类的具体用法?TypeScript ApiService怎么用?TypeScript ApiService使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
在下文中一共展示了ApiService类的6个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的TypeScript代码示例。
示例1: updatePassword
updatePassword(email, currentPassword, password): Promise<Auth> {
return this.apiService.updateVisitorPassword(email, currentPassword, password).then(
(authData) => {
return this.authDataPersistenceService.save(authData);
}
);
}
示例2: signIn
signIn(email: string, password: string): Promise<Auth|AuthError> {
return this.apiService.login(email, password)
.then((response: Auth) => {
console.log('AuthService, signIn succeed');
if (response.error === 'password expired') {
this.authDataPersistenceService.set(response);
return Promise.reject({message: 'passwordExpired'});
} else {
return this.authDataPersistenceService.save(response);
}
});
}
示例3: fetchByCategory
fetchByCategory(id: number): Promise<Item[]> {
return this.apiService.fetchItemsByCategory(id);
}
示例4: fetchAll
fetchAll(): Promise<Item[]> {
return this.apiService.fetchLatestItems();
}
示例5: fetchById
fetchById(id: string): Promise<Item> {
return this.apiService.fetchItemById(id);
}
示例6: forgotPassword
forgotPassword(email: string): Promise<void> {
return this.apiService.forgotPassword(email);
}