@iomechs/angular-service-bot
v0.1.3
Published
[![Actions Status](https://github.com/iomechs/angular-service-bot/workflows/CI/badge.svg)](https://github.com/iomechs/angular-service-bot/actions)
Downloads
30
Readme
Angular Service Bot Package
@iomechs/angular-service-bot
A simple, easily to use package to use servicebot.io with Angular apps.
Demo
https://iomechs.github.io/angular-service-bot/demo
Docs
https://iomechs.github.io/angular-service-bot
Dependencies
Usage
Install the package in your project's folder by using npm or yarn:
npm install @iomechs/angular-service-bot --save
# OR
yarn add @iomechs/angular-service-bot -S
Import AngularServiceBotModule in your AppModule as below:
import { AngularServiceBotModule } from '@iomechs/angular-service-bot';
@NgModule({
declarations: [
AppComponent,
],
imports: [
BrowserModule,
AppRoutingModule,
BrowserAnimationsModule,
AngularServiceBotModule, // <-- here
]
});
In your component:
import { Component } from '@angular/core';
@Component({
selector: 'asb-root',
templateUrl: './app.component.html',
styleUrls: ['./app.component.scss'],
})
export class AppComponent {
serviceBotParams = {
servicebot_id: 'E0OQN0P0Dort', // LIVE & TEST MODE IDs ARE DIFFERENT
service: 'Flat Subscription',
email: '[email protected]',
handleResponse: async (payload) => {
if (payload.event === 'create_subscription') {
console.log('Response Object ', payload.response);
}
}
};
constructor() {}
}
In your template:
<div class="angular-service-bot">
<io-angular-service-bot [serviceBotParams]="serviceBotParams"></io-angular-service-bot>
</div>
For further details related service bot params visit service bot params details page.
License
MIT © IOMechs