【问题标题】:Angular show product Gallery in modalAngular 以模态显示产品库
【发布时间】:2015-03-30 14:22:16
【问题描述】:

继上一个问题之后,我需要在 col-xs-5 的模式中显示我的产品库:

<div class="modal fade" id="product-details-modal" tabindex="-1" role="dialog" aria-labelledby="myModalLabel" aria-hidden="true">
    <div class="modal-dialog">
      <div class="modal-content">
        <button aria-hidden="true" data-dismiss="modal" class="close" type="button">×</button>
        <div class="col-xs-5">
          <product-gallery></product-gallery>
        </div>
        <!--/.col-xs-5-->
        <div class="col-xs-7 modal-details">
          <div class="modal-details-inner">
            <p>{{store.selected.name}}</p>
            <p>{{store.selected.description}}</p>
          </div><!--/.modal-details-inner-->
        </div><!--/.xs-7-->
      </div><!--/.modal-content-->
    </div><!--/.modal-dialog-->
  </div>

正在从我的 json 文件中提取所有其他信息并正常显示。但是只有当我在模态框内放置一个 ng-repeat 时,Gallery 才有效,这反过来又明显显示了所有产品的所有图库图像。

我如何只显示该特定产品项目的图库?我已经添加了下面的代码……

http://plnkr.co/edit/ouKSSnnAnTZvLyyePOXS?p=preview

非常感谢

【问题讨论】:

    标签: angularjs twitter-bootstrap angularjs-directive modal-dialog image-gallery


    【解决方案1】:

    图库图片数组可以在store.selected对象中访问:

    <div class='gallery' ng-show="store.selected.images.length">
      ...
    </div>
    

    这是您的 plunker 的更新:http://plnkr.co/edit/1mIl9tiK320kzFXyZqsV?p=preview

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 2019-11-28
      • 1970-01-01
      • 2019-04-01
      • 1970-01-01
      • 2014-06-18
      • 2015-08-29
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多