wakanda客户端不在systemjs配置中工作

时间:2017-02-20 16:15:01

标签: angular wakanda

我在wakanda中使用systemjs配置创建了一个项目。当我尝试使用wakanda-client软件包时,我收到以下错误,说明

  

未处理的承诺拒绝

当我为wakanda-client

创建构造函数时

这是我的文件

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();
  }
}

让任何人遇到此问题

提前致谢

0 个答案:

没有答案