html图像元素不显示图像

时间:2022-09-01 09:37:14

I am using a Ionic 2 popover, to display an image. However, the image is not displaying in the modal.

我正在使用Ionic 2 popover来显示图像。但是,图像未显示在模态中。

I have the following code. How do I get it to display the image?

我有以下代码。如何让它显示图像?

import { Component } from '@angular/core';
import { NavParams } from 'ionic-angular';

@Component({
  template: `
    <ion-content padding id="image-popover">
      <ion-list>
        <ion-row>
          <ion-col>
            <center>
                <img class="item-stable" src="{{image}} height="75" width="75""/>
                <p>{{text}}</p>
            </center>
          </ion-col>
        </ion-row>
      </ion-list>
    </ion-content>
  `
})
export class ImagePopOverPage {
  private image: string = null;
  private text: string = null;

  constructor(private navParams: NavParams) {
    this.image = navParams.get('image');
    this.text = navParams.get('text');
  }
}

And it displays this:

它显示了这个:

html图像元素不显示图像

1 个解决方案

#1


1  

Sorry, my mistake. I had "quotation" marks in the wrong place.

抱歉,是我的错。我在错误的地方有“引号”标记。

#1


1  

Sorry, my mistake. I had "quotation" marks in the wrong place.

抱歉,是我的错。我在错误的地方有“引号”标记。