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