在 textAngular 编辑器中使用角度引导模式插入链接
use angular bootstrap modal for insert link in textAngular Editor
我想从 angularjs 引导模式用于插入链接,因此在 textAngularSetup 中.js文件包含$modal作为依赖项,并在插入链接操作函数中使用它:
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 编辑器中不影响的命令。有什么方法可以从引导模式用于插入链接吗?
由于这个问题是在两个地方提出的,我在这里链接到 github 问题中的答案:https://github.com/fraywing/textAngular/issues/419
相关文章:
- 如何通过模式“弹出窗口”将值插入文本字段
- 仅在模式窗体中打开时插入值
- 创建猫鼬模式并插入文档
- 节点 JS / Mongo 插入而不匹配模式
- 显示动态插入的模式按钮
- 在 textAngular 编辑器中使用角度引导模式插入链接
- REGEX-在html注释模式之间插入内容
- 使用Regex在字符串模式出现前后插入文本
- 从引导模式获取值,进行处理,然后将值插入数据库
- Meteor.js&Collection2:更新在子模式中插入新对象的方法
- Emacs:是否可以在js2模式下自动插入分号
- "执行insertHtml命令“”时出错;当在“”中插入html时,cleditor中的消息;查看源“;模式
- 我应该在哪个Shopify.liquid文件中插入主页模式
- 在Iframe外部的按钮触发的设计模式Iframe中插入文本
- 使用Node.js在现有Mongoose模式中插入对象ID's到数组中
- JS插入两个连续的文本节点在一个跨度不当时,不在调试模式
- 揭示模块模式:在哪里为模块访问插入变量
- React和Dropzone.js:以“插入模式”上传图像
- 插入文档的动态iframe为标准模式,默认为怪僻模式
- 如何在Mongoose中添加对另一个模式的引用,并通过json插入数据