0.0.17 • Published 8 years ago
construct-angular v0.0.17
Angular2 Construct API Wrapper
This repository is an Angular 2 provider for the Accela ConstructApi.
Installation
npm install --save construct-angular
Usage
- Setup the Construct API as a dependency during your app bootstrap.
import { ConstructApi } from 'construct-angular';
- Add the Construct API as a provider during your app bootstrap.
@App({
providers: [
ConstructApi
]
})
- Setup the Construct API during your app bootstrap.
constructor(private constructApi:ConstructApi)
initializeApp() {
this.constructApi.setup({
apiHost: 'https://apis.accela.com'
});
}
- Setup the auth token on the Construct API once a user logs in.
this.auth.user$.subscribe(user => {
this.constructApi.setAuthToken(user.authToken);
});
Contributing
Building Steps
git clone https://github.com/Accela-Inc/construct-angular.git
cd construct-angular
npm install
npm run all
After executing all task from the build script the browser window will open. Click the Get Records button, and the demo app will use the Construct API wrapper to pull records from the actual API.
The typescript transpiler is executed in watch mode so any change saved on both component and test application will apply immediately and will refresh the browser page.
Next steps
- Add unit tests
- Contributions welcome
Updating the NPM package
https://docs.npmjs.com/getting-started/publishing-npm-packages