@obelisk/ngx
Advanced tools
Comparing version 0.3.0-rc.0 to 2.0.0-alpha.0
{ | ||
"name": "@obelisk/ngx", | ||
"version": "0.3.0-rc.0", | ||
"version": "2.0.0-alpha.0", | ||
"peerDependencies": { | ||
@@ -5,0 +5,0 @@ "@angular/common": "^7.2.0", |
@@ -1,27 +0,57 @@ | ||
# ObeliskNgx | ||
# @obelisk/ngx | ||
This project was generated with [Angular CLI](https://github.com/angular/angular-cli) version 7.3.3. | ||
[![pipeline status](https://gitlab.ilabt.imec.be/ibcndevs/iot-stack/obelisk-ngx/badges/master/pipeline.svg)](https://gitlab.ilabt.imec.be/ibcndevs/iot-stack/iot-stack-client/commits/master) | ||
## Development server | ||
A client library Angular Module written in Typescript to interact with [@obelisk/client](https://www.npmjs.com/package/@obelisk/client). | ||
Run `ng serve` for a dev server. Navigate to `http://localhost:4200/`. The app will automatically reload if you change any of the source files. | ||
## Prerequisites | ||
This library makes use of: | ||
* **RxJS** (Reactive Extensions for JavaScript). RxJS comes as a peer dependency. | ||
* @obelisk/client | ||
## Code scaffolding | ||
## Installation | ||
```bash | ||
npm install @obelisk/client @obelisk/ngx rxjs --save | ||
``` | ||
Run `ng generate component component-name` to generate a new component. You can also use `ng generate directive|pipe|service|class|guard|interface|enum|module`. | ||
## Usage | ||
## Build | ||
To include it in you main AppModule, do this: | ||
Run `ng build` to build the project. The build artifacts will be stored in the `dist/` directory. Use the `--prod` flag for a production build. | ||
```typescript | ||
import { APP_INITIALIZER } from '@angular/core'; | ||
import { ClientOptions } from '@obelisk/client'; | ||
import { ObeliskNgxModule, ObeliskService, OBELISK_DEPS, factory } from '@obelisk/ngx'; | ||
## Running unit tests | ||
const options: ClientOptions = { | ||
host: 'https://obelisk.ilabt.imec.be', | ||
apiVersion: 'v1', | ||
realm: 'idlab-iot', | ||
clientId: 'my-client' | ||
} | ||
Run `ng test` to execute the unit tests via [Karma](https://karma-runner.github.io). | ||
@NgModule({ | ||
declarations: [...], | ||
imports: [ | ||
..., | ||
ObeliskNgxModule.forRoot(options) | ||
], | ||
providers: [ | ||
{ | ||
provide: APP_INITIALIZER, | ||
deps: OBELISK_DEPS, | ||
useFactory: factory, | ||
multi: true | ||
} | ||
... | ||
], | ||
bootstrap: [AppComponent] | ||
}) | ||
export class AppModule { } | ||
``` | ||
## Running end-to-end tests | ||
Now you can inject ObeliskService and get an already initialized client from it any time. | ||
Run `ng e2e` to execute the end-to-end tests via [Protractor](http://www.protractortest.org/). | ||
*If you are logged in it will handle all the tokens in the headers for you.* | ||
## Further help | ||
To get more help on the Angular CLI use `ng help` or go check out the [Angular CLI README](https://github.com/angular/angular-cli/blob/master/README.md). | ||
[full-docs]: https://obelisk.ilabt.imec.be/api/v1/client-docs |
Native code
Supply chain riskContains native code (e.g., compiled binaries or shared libraries). Including native code can obscure malicious behavior.
Found 1 instance in 1 package
Native code
Supply chain riskContains native code (e.g., compiled binaries or shared libraries). Including native code can obscure malicious behavior.
Found 1 instance in 1 package
Major refactor
Supply chain riskPackage has recently undergone a major refactor. It may be unstable or indicate significant internal changes. Use caution when updating to versions that include significant changes.
Found 1 instance in 1 package
65591
57
1