从浏览器中选择图像文件后打开模态 [英] Open Modal After selecting Image File from Browser

查看:121
本文介绍了从浏览器中选择图像文件后打开模态的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在使用angular-croppie裁剪图像.收割机工作正常,但是有问题.我想在《莫代尔》中打开收割机.但是,当我单击choose file button使用文件资源管理器窗口打开的模式时,我想在从文件资源管理器中选择图像后打开模式,然后在裁纸器中显示该图像.我正在为此功能使用AngularJs和Jquery.

I'm using angular-croppie to crop my images. the cropper is working fine but there is a problem. I want to open the cropper in The Modal. But when I click on the choose file button the modal open with the file explorer window, I want to open the modal after selecting an image from the file explorer and then show that image in the cropper. I'm using AngularJs and Jquery for this function.

我的代码的CodePen链接是此处

CodePen link for my code is here

我已尽力解释此问题,但如果您仍然不明白,请单击给定的链接. 请不要将此问题标记为重复,因为我已经在StackOverflow上进行了搜索,但仍然找不到解决方案.

I've tried my best to explain this issue but if you still don't understand then click on the given link. Please don't mark this question as a duplicate because I've already searched on StackOverflow but still couldn't find the solution.

推荐答案

我刚刚在文件(长度)中添加了一个有角度的$watch,它触发了弹出窗口而不是文件打开按钮,因此效果很好.

I just added an angular $watch to the file (length) which triggered the popup instead of the file open button and it works fine.

这是您更新的代码笔

codepen

这篇关于从浏览器中选择图像文件后打开模态的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆