Needless Patchouli Manufacture

    This package has been deprecated

    Author message:

    Package no longer supported. Please use @livechat/widget-angular instead.

    @livechat/angular-widget
    TypeScript icon, indicating that this package has built-in type declarations

    0.3.1 • Public • Published

    Livechat Widget for Angular

    Library to integrate LiveChat Widget with your Angular App.

    Demo

    StackBlitz live example.

    Installation

    npm install --save @livechat/angular-widget

    Usage

    Import LivechatWidgetModule in Angular AppModule.
    import { BrowserModule } from '@angular/platform-browser';
    import { NgModule } from '@angular/core';
    import { AppComponent } from './app.component';
    import { LivechatWidgetModule } from '@livechat/angular-widget'
     
    @NgModule({
      declarations: [
        AppComponent
      ],
      imports: [
        BrowserModule,
        LivechatWidgetModule,
      ],
      providers: [],
      bootstrap: [
          AppComponent,
        ]
    })
    export class AppModule { }
    Use the LiveChat Angular Widget in your template:
    <livechat-widget licenseId="10073628"></livechat-widget>

    As optional parameters, you can define:

    • group
    • chatBetweenGroups
    • params
    • visitor
    • gaVersion

    To get more details about usage of the optional paramteres please read our tracking code documentation.

    Access to the LiveChat Widget API using callback method
    <livechat-widget licenseId="10073628" (onChatLoaded)="onChatLoaded($event)"></livechat-widget>
    import { Component } from '@angular/core';
    import { LiveChatWidgetApiModel } from '@livechat/angular-widget';
     
    @Component({
      selector: 'app-root',
      templateUrl: './app.component.html',
    })
    export class AppComponent {
      liveChatApi: LiveChatWidgetApiModel
     
      constructor() { }
     
      onChatLoaded(api: LiveChatWidgetApiModel) {
        this.liveChatApi = api;
      }
    }
    Access to the LiveChat Widget API using @ViewChild decorator
    <livechat-widget #liveChatWidget licenseId="10073628" ></livechat-widget>
    import { Component, ViewChild, OnInit, OnDestroy } from '@angular/core';
    import { LiveChatWidgetModel } from '@livechat/angular-widget';
    import { Subscription } from 'rxjs';
     
    @Component({
      selector: 'app-root',
      templateUrl: './app.component.html',
    })
    export class AppComponent implements OnInit, OnDestroy {
      @ViewChild('liveChatWidget') liveChatWidget: LiveChatWidgetModel;
      liveChatWidget$: Subscription = new Subscription();
      liveChatApi: LiveChatWidgetApiModel;
     
      constructor() { }
     
      ngOnInit(): void {
        this.liveChatWidget$ = this.liveChatWidget.onChatLoaded.subscribe((api: LiveChatWidgetApiModel) => this.liveChatApi = api)
      }
     
      ngOnDestroy(): void {
          this.liveChatWidget$.unsubscribe();
      }
    }

    Install

    npm i @livechat/angular-widget

    DownloadsWeekly Downloads

    1,015

    Version

    0.3.1

    License

    MIT

    Unpacked Size

    217 kB

    Total Files

    27

    Last publish

    Collaborators

    • grzgajda
    • bstopyra
    • m.teczynski
    • misterkuka
    • jakubpyzio
    • rkawka
    • bolchowka
    • lukiq
    • f.jaskolski
    • msypko
    • bamboo-livechat
    • olek_livechat
    • skix
    • s.graczyk.livechat
    • michalpaszczakowski
    • afedyk
    • andarist
    • konradk
    • t.burzlc
    • dmgawel
    • jedrek
    • k.zajac
    • dobrochna.przybylek
    • lkrolak
    • hstaniszewski
    • chatbot-com
    • jakubsikora
    • norbertprocak
    • walaszczykm
    • dominikslawkowski
    • klarzynskik
    • ale-kacperczyk
    • gogolix
    • sambor
    • macpankiewicz
    • mreszke
    • k-kozak
    • voyy
    • bbartek
    • mdebski
    • shwarcu
    • jfedyczak
    • paulinag
    • morus12
    • tomaszratajczyk
    • janowsiany
    • kogierman
    • dzabrzenski
    • bartoszgamza
    • wouga
    • ttrzcinski
    • mzielonka
    • alithanar
    • msawickilc
    • jawinski
    • gh-actions-livechat
    • ewaryst
    • oliwiapolec
    • przemuh
    • arturfracala
    • panr
    • vbezpalko