Angular apollo
An API client for the 7digital Apollo platform built for Angular 2 projects.
Installation
npm install angular-apollo
Usage
For a web project:
;;; bootstrapAppComponent, ;
For an ionic2 project you will need to override the token store:
;;; ionicBootstrapAppComponent, ;
Handling authentication errors
You may want your app to react to failed authentication attempts, in this case, you can register a handler for the token store errors
export class AppComponent {
constructor(tokenStore:TokenStore){
tokenStore.events.subscribe(() => {}, () => {
redirectToLoginPage();
});
}
}
Running the tests
Running the E2E tests requires the following environment variables:
TEST_USER_NAME
TEST_PASSWORD
TEST_DEVICE_ID
TEST_DEVICE_NAME
TEST_API_URL
Currently all tests are run with the npm run test
command.