图像未显示上面的列表离子

时间:2016-10-07 00:10:53

标签: angularjs ionic-framework

我正在尝试在离子页面的顶部放置一定高度的全宽图像(在导航栏中,在列表之前)。图像确实有效,因为我把它放在列表中,它只是没有显示在顶部。有什么想法吗?

<ion-view view-title="{{pageTitle}}">
  <ion-content>
    <img ng-src="{{post.acf.top_image_full_list}}">
  <ion-list>
      <div class="list">
        <a ng-repeat="post in posts"
           href="#/tab/watch/{{current_category_id}}/{{post.id}}"
           class="item item-thumbnail-left">

            <img ng-src="{{post.acf.top_single_msg}}">
            <div class="postcat">
            <span style="font-size: 17px;">{{post.title.rendered}}</span>
            <p>{{post.date | date}}</p></div>
        </a>
      </div>
    </ion-list>
  </ion-content>
</ion-view>

No image above the list

1 个答案:

答案 0 :(得分:0)

您正在尝试访问图片post.acf.top_image_full_list - 这是一个'post'对象。但是,您不会在列表中使用行<a ng-repeat="post in posts"进一步向下创建“post”对象 - 您正尝试在ng-repeat之外使用“post”对象。