简体   繁体   English

ngImgCrop无法通过模式弹出窗口工作吗?

[英]ngImgCrop is not working through modal popup?

Im using img-crop directive,when I am placing this directive in modal popup content its not working and not showing image and crop area.Im using material design md-dialog as popup..Here is my sample code.. 我正在使用img-crop指令,当我将该指令放置在模式弹出窗口内容中时不起作用,并且不显示图像和裁剪区域。我正在使用材料设计md-dialog作为弹出窗口。这是我的示例代码。

<div class="cropArea">

    <img-crop image="myImage" area-type={{areaType}} result-image="myCroppedImage">
    </img-crop>
</div>

and this is my modal popup: 这是我的模式弹出窗口:

 $scope.showImage = function (ev) {
            $mdDialog.show({
                templateUrl: '/demo/modelPopup.html',
                targetEvent: ev
            }).then();
        };

not exactly this,but I want to do cropping in popup instead of my page...Plz help me..... 不完全是这样,但是我想在弹出窗口中而不是在页面中进行裁剪...请帮助我.....

Refer to my answer on ngImgCrop not working inside UI Modal . 请参阅我对ngImgCrop在UI Modal内不起作用的答案。 The basic problem is that you are trying to bind an event on a DOM element that might not exist at the time you do the binding. 基本问题是您尝试在DOM元素上绑定事件,而该事件在执行绑定时可能不存在。 The work around is to wrap the binding in a timeout as shown in the linked answer. 解决方法是将绑定包装为超时,如链接的答案所示。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM