0

I created a project in wakanda with systemjs configuration. When i am try to use the wakanda-client package i am getting the following error stating that

Unhandled promise rejection

when i create a constructorm for the wakanda-client

Here is my files

app.component.ts

 import { Component } from '@angular/core'; import {Wakanda} from
 './wakanda.service';

 @Component({   selector: 'my-app',   template: `<h1>Welcome to 
 {{name}}</h1>   <button (click)= "clickFunction() ">Testing</button>
      `, }) export class AppComponent  {  name = 'Angular'; 

 constructor(private wakanda:Wakanda){}


}

wakanda.service.ts

import {WakandaClient} from 'wakanda-client';

export class Wakanda {

  private _client: WakandaClient;
  private _catalog;

  constructor() {
    //this._client = new WakandaClient({ host: 'http://127.0.0.1:8081' });
    this._client = new WakandaClient({});
    this._catalog = null;
  }

  get catalog() {
    if (!this._catalog) {
      return this._client.getCatalog().then(c => {
        this._catalog = c;

        return c;
      });
    }

    return Promise.resolve(this._catalog);
  }

  get directory() {
    return this._client.directory;
  }

  get wakandaClientVersion() {
    return this._client.version();
  }
}

have anyone having this issue

Thanks in advance

skid
  • 958
  • 4
  • 13
  • 29

0 Answers0