呈现Image类型的SQL Server

时间:2017-07-31 00:55:46

标签: sql-server node.js angular express

我打电话给叔叔。我有一个应用程序,我正在处理我想要返回存储在Image类型的SQL Server列中的图像。

我使用rest api返回对象,然后返回正常。

Here's what the json object looks like.

我的HTML会执行* ng等待返回的图像。



<div *ngIf="imagesFound">
    <ngb-carousel [interval]="1000" [wrap]="true" [keyboard]="true" >
        <ng-template ngbSlide *ngFor="let image of images">
          <img class="center-block" src="{{image.Image}}">
        </ng-template>
    </ngb-carousel>
  </div>
&#13;
&#13;
&#13;

我在点击时调用方法。

&#13;
&#13;
searchImages(query: string){
    this.searching = true;
    return this._imageService.getImage(query).subscribe(
      data => this.handleSuccess(data),
      error => this.handleError,
      () => this.searching = false
    )
  }
  
  handleSuccess(data){
    if (data.recordset) {
      this.imagesFound = true;
      this.emptyData =false;
      this.images = data.recordset;
      console.log(data.recordset);
    } else {
      this.imagesFound = false;
      this.emptyData =true;
      console.log("no images found");
    }
  }
&#13;
&#13;
&#13;

我收到了丢失的图像。我真的卡住了,可以使用一些指导。有人对我有什么建议吗?

0 个答案:

没有答案