Skip to content

socobox/sbxcloudjs-angular

Repository files navigation

Angular4library

SBX

Welcome, this repo is the Angular 5 implementation of sbxcorejs library.

All the functions have the implementation with Promise and with Rxjs, in case of using Promise, a polyfill of Promise must be installed if the browser does not have Promise implementation.

Examples of polyfill:

Initialization

In app.module.ts file:

import { SbxCoreModule, SbxSessionModule, SbxSessionService } from 'sbxangular';
@NgModule({
  declarations: [
    AppComponent
  ],
  imports: [
    SbxCoreModule,
    SbxSessionModule
  ],
  bootstrap: [AppComponent]
})
export class AppModule {
  constructor(private session: SbxSessionService) {
    this.session.initialize(domain, appKey);
  }
}

Also, you can initialize with Angular environment:

In environment.ts file:

export const environment = {
  appKey: 'xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx',
  domain: x // Integer
}

then, in app.module.ts file:

import { SbxCoreModule, SbxSessionModule, SbxSessionService } from 'sbxangular';
import { environment } from '../environments/environment';

@NgModule({
  declarations: [
    AppComponent
  ],
  imports: [
    SbxCoreModule,
    SbxSessionModule
  ],
  bootstrap: [AppComponent]
})
export class AppModule {
  constructor(private sbxSessionService: SbxSessionService) {
    this.sbxSessionService.initializeWithEnvironment(environment);
  }
}

About

this is the core for angular4

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Contributors 3

  •  
  •  
  •