A simple, easily to use package to use servicebot.io with Angular apps.
https://iomechs.github.io/angular-service-bot/demo
https://iomechs.github.io/angular-service-bot
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.
MIT © IOMechs