README
Angular2 Construct API Wrapper
This repository is an Angular 2 provider for the Accela ConstructApi.
Installation
npm install --save construct-angular2
Usage
- Setup the ** Construct API** as a dependency during your app bootstrap.
import { ConstructApi } from 'construct-angular2';
- 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',
appId: '<your api id here>'
});
}
- Setup the auth token on the ** Construct API** once a user logs in.
this.auth.user$.subscribe(user => {
this.constructApi.setAuthToken(user.authToken);
this.constructApi.setAgency(user.agency);
this.constructApi.setEnvironment(user.env);
});
Contributing
Building Steps
git clone https://github.com/Accela-Inc/construct-angular2.git
cd construct-angular2
npm install
typings install
npm run test
Testing
To test, run npm test
Publishing the npm package
- Make your changes to the repo
- Run
npm test
to ensure everything works properly - Commit your changes to the repo
- Run
npm run prepublish
- Run
npm version patch
path is 1.0.x, minor is 1.x.0 and major is x.0.0 - Run
npm publish
Next steps
- Add more unit tests
- Contributions welcome
Updating the NPM package
https://docs.npmjs.com/getting-started/publishing-npm-packages