使用 angular bootstrap modal 在 textAngular 编辑器中插入链接 [英] use angular bootstrap modal for insert link in textAngular Editor

查看:24
本文介绍了使用 angular bootstrap modal 在 textAngular 编辑器中插入链接的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想使用 angularjs bootstrap modal 来插入链接,所以在 textAngularSetup.js 文件中包含 $modal 作为依赖项,并在 insertLink 动作函数中使用它:

i want use from angularjs bootstrap modal for insert link , so in textAngularSetup.js file include $modal as dependency, and use it in insertLink action function:

taRegisterTool('insertLink',{
    tooltiptext: taTranslations.insertLink.tooltip,
    iconclass: 'icon-link',
    action: function(){
        var that=this;
        var result={
            texttodisplay:'ahmad',
            webaddress:'',
            isOk:''
        }
        var insertLinkmodalScope=$rootScope.$new();
        insertLinkmodalScope.modalInstance=$modal.open({
            templateUrl: 'editor/views/insertlink.client.view.html',
            controller: 'EditorController',
            size: 'sm',
            scope:insertLinkmodalScope,
            resolve:{
                        //pass result to modal
                link:function(){
                    return result;
                }
            }
        });
        //define result modal , when user complete result information 
        insertLinkmodalScope.modalInstance.result.then(function(result){
            if (result.isOk) {
                return that.$editor().wrapSelection('createLink', result.webaddress, true);
            }
        });

    },
   activeState: ....,
   onElementSelect: ....
});

当我在 chrome 中调试代码时,找出已执行但在 HTML 编辑器中没有影响的命令.有没有办法从引导模式中使用插入链接?

when i debug code in chrome, find out the command executed but didn't affect in HTML editor. is any way to use from bootstrap modal for inset link ?

推荐答案

因为有人在两个地方问过这个问题,所以我在这里链接到 github 问题中的答案:https://github.com/fraywing/textAngular/issues/419

As this was asked in two places, I'm linking to the answer in the github issues here: https://github.com/fraywing/textAngular/issues/419

这篇关于使用 angular bootstrap modal 在 textAngular 编辑器中插入链接的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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