Get contents

Once the package is installed, import the Dialogue Wise module into the app.module. For this you will need to add

import {DialogueWiseModule} from 'dialogue-wise';

and DialogueWiseModule under imports. Your code should now look something like this.

import { BrowserModule } from '@angular/platform-browser';
import { NgModule } from '@angular/core';
import { FormsModule } from '@angular/forms';
import { AppComponent } from './app.component';
import {DialogueWiseModule} from 'dialogue-wise';

@NgModule({
  declarations: [
    AppComponent
  ],
  imports: [
    BrowserModule,
    FormsModule,
    DialogueWiseModule      
  ],
  providers: [],
  bootstrap: [AppComponent]
})
export class AppModule { }

Now you are ready to call the Dialogue Wise API from your component and get the content. You will need to import the DialogueWiseService and DialogueWiseRequest

import {DialogueWiseService,DialogueWiseRequest} from 'dialogue-wise';

Now prepare the payload for which you will need to pass the apiKey, dialogueName and emailHash.

var request:DialogueWiseRequest = new DialogueWiseRequest();
    request.apiKey="[API Key]"; 
    request.dialogueName="[The Slug]"; 
    request.emailHash='[Email Hash]'; 

If your dialogue uses variables and you wish to pass variable values then you will need to set the variableList property as well.

request.variableList = new Map<string,[Datatype you want to pass like string or number]>();
request.variableList.set("@variableName",[The variable value]);

You’re all set now. You can call the getDialogue method and pass the payload.

this.dialoguewise.getDialogue(request).subscribe(res=>
        //Your content will be available in the res object
      ,null,()=>{
        //Do stuff once content is delivered
      });

A sample project is available on Github which can give you a better understanding.