在函数中传递的图像不会显示在bootstrap模式弹出窗口中

时间:2017-12-05 06:04:14

标签: angularjs twitter-bootstrap-3

我有一个以小图标显示的图像,当我点击图像时,我想在函数imagesource中传递showPhotos()并在弹出窗口中显示它。我尝试过这样做,但是我的弹出窗口没有照片就空了。

我的缩略图html:

 <div class="image" ng-repeat="image in filteredImages track by $index">

         <div class="dropdown">
        <img ng-src="{{image.source}}" class="images" style="cursor: pointer;" ng-click="showPhotos(image.source)"/>
                   </div>
              </div>

JS:

     $scope.model.selectedImage = "";
    $scope.showPhotos = function(image) {
          $scope.model.selectedImage = image;
            $('#imagePreview').modal('show');
        }

ImagePreview Modal Html:

 <div class="modal fade" id="imagePreview" role="dialog"  data-keyboard="false" data-backdrop="static" style="padding-top: 3em;">

            <div class="modal-dialog">

                <div class="modal-content imagemodal" style="text-align: center;">

                    <div class="modal-body" style="background: #eee;">


                    <div class="row">
                        <div class="image" >
                  <img class="imagePreview" ng-src="{{model.selectedImage}}"/>

            </div>
        </div>
           </div>
            </div>
              </div>

0 个答案:

没有答案