ng-show不承认真实情况

时间:2016-04-20 12:01:01

标签: angularjs iframe

我在AngularJS ng-show中遇到了问题。我有以下结构:

<div class="boxresultados">
      <div ng-click="mostraImovel = true;" id="detImoveis"  ng-repeat="imovel in imoveis_filtrados | orderBy : sortType : sortReverse | paginacao:pag:ipp" >

        <a href="" target="iframe_imv" >

          <div class="thumbresultado">
            <img alt="" height="200px" width="255px" ng-show="imagens.length>0" src="" style="z-index: 2;" />
            <img alt="" height="200px" width="255px" ng-show="imagens.length>0" src="images/semimagem.png" style="z-index: 2;" />
          </div>
      </div>
</div>

当我点击此区域时,我必须以弹出方式在同一页面上打开我的iframe。

我的iframe:

<iframe name="iframe_imv" style="border:none; top:70px;" id="iframe_imv" src="" class="pagimovelshow" ng-show="mostraImovel == true" webkitAllowFullScreen mozallowfullscreen allowFullScreen></iframe>

正如您所看到的iframe有一个ng-show = "mostraImovel == true",然而,他并没有意识到这是true。我已经测试了这个条件,但我看到它评估为true,然而,我的iframe仍然是隐藏的。

2 个答案:

答案 0 :(得分:0)

只需复制并通过代码

<iframe name="iframe_imv" style="border:none; top:70px;background: red;
    height: 200px;" id="iframe_imv" src="" class="pagimovelshow" ng-show="mostraImovel" webkitAllowFullScreen mozallowfullscreen allowFullScreen></iframe>

答案 1 :(得分:0)

您不会显示您的javascript和控制器。我想知道是否需要将mostraImovel指定为范围变量?只是一个想法。

相关问题