zqjimlove / angular-ueditor Goto Github PK
View Code? Open in Web Editor NEWAngular port for Baidu UEditor
Home Page: http://inwoo.me
Angular port for Baidu UEditor
Home Page: http://inwoo.me
想请问下.我用
$scope.ready = function(editor){ ue = editor; }
获得了实例
然后使用
ue.execCommand('inserthtml', '+$scope.activeMediaImg.url+');
在当前光标位置插入html内容.内容是插入成功了.不过还要对model重新赋值才生效
$scope.activeNewsItem.content = ue.getContent();
而且执行execCommand会报下面的错误
Error: [$rootScope:inprog] http://errors.angularjs.org/1.4.8/$rootScope/inprog?p0=%24apply
请问这是什么原因呢?
报告一个问题:
div class="ueditor" id="whatever" name="post" ng-model="post.content" ready="ueReady" config="ueConfig" required
元素中不能出现id属性, 否则就报错Cannot read property 'length' of undefined, Cannot set property 'innerHTML' of null
在angular-ueditor.js
最后面 new _NGUeditor();
的前面 给window全局赋值 例如window.Ue = new _NGUeditor();
然后在编辑完成的时候 发送请求之前
添加一条代码
vm.newInfo.content = ue.editor.body.innerHTML;
使用bower安装失败
bower install angular-ueditor --save
报错如下:
bower angular-ueditor#* not-cached https://github.com/zqjimlove/angular-ueditor.git#*
bower angular-ueditor#* resolve https://github.com/zqjimlove/angular-ueditor.git#*
bower angular-ueditor#* checkout master
bower angular-ueditor#* invalid-meta The "main" field cannot contain minified files
bower angular-ueditor#* resolved https://github.com/zqjimlove/angular-ueditor.git#b0a10e4a03
_Bug if enable catch remote image:_
When enable catch remote image by set config item
catchRemoteImageEnable = true
Paste image into editor.
After request of http://server.com/path/to/controller?action=catchimage...
completed,
the html, or let's say img src
, in the editor body wil be updated (you can check by inspect element),
but when you debug or submit your ng-model
, the img src
in the content hasn't been updated.
_An easy fix for now:_
Catch event catchremotesuccess
by addListener("catchremotesuccess",...)
.
Code:
_self.editor.addListener("contentChange", function() {
ctrl.$setViewValue(_self.editor.getContent());
if (!_updateByRender) {
if (!$S.$$phase) {
$S.$apply();
}
}
_updateByRender = false;
});
// add code here
// catch catchremotesuccess event and react the same as event contentChange
_self.editor.addListener("catchremotesuccess", function() {
ctrl.$setViewValue(_self.editor.getContent());
if (!_updateByRender) {
if (!$S.$$phase) {
$S.$apply();
}
}
_updateByRender = false;
});
否则,会一直驻留内存中。
运行正常后,富文本编辑器头部没有插入视频的功能吗
I use angular-ueditor like followings
<a href="/test">test</a>
...
<div class="ueditor" name="content" ng-model="content" ></div>
When I first click 'test' link, nothing happened. But, When I click it again, I can jump to the /test.
If I remove angular-ueditor, it will be normal.
我使用了你的v0.0.2压缩文件不能运行,但是不压缩的是可以的,你可能要看一下你压缩时是否损坏了
请教下 在单页应用中 结合 requirejs 如何使用呢?
用requirejs 结合楼主这个在 单页应用中 做菜单切换时报错
ueditor.all.js:7563 Uncaught TypeError: Cannot read property 'simpleupload' of undefinedEditor._callCmdFn @ uemy.js:7563Editor.queryCommandState @ uemy.js:7625(anonymous function) @ uemy.js:24528
ueditor.all.js:3920 Uncaught TypeError: Cannot read property 'nodeType' of undefined
ueditor.all.js:7875 Uncaught TypeError: Cannot read property 'lang' of undefined
请教下 如何修改呢 ?
你好
我使用 https://github.com/zhangfisher/DjangoUeditor
搭配您的这个 angular-ueditor
可以上传图,但是,
比如,我就添加一张图,从我的剪贴板 直接粘贴,虽然编辑框里面图片已经上传成功 服务器也返回了图片网址了,可是 变量里面 存的还是 /ueditor/themes/default/images/spacer.gif 这个图
我必须,在编辑框输入其他内容,变量里的图片网址才会更新
请问前辈 我该如何操作,我对js不太懂
输入htmlentity字符不会更新ng-model,比如<>"
,应该是ueditor的bug( fex-team/ueditor#2223 ),但是也应该可以用其他的办法处理。
选择多张图片 或者视频上传的时候 ueditor $G is not defined
源代码57行有错误:_self.modelContent这个值为空
angular报:Error: [$rootScope:inprog] $digest already in progress,位置在52行
我有个项目也像你这样封装了指令,有个问题不知道你有没有遇到过:
前提:项目里用了uiRouter,现有两个路由页面(A,B),B是带ueditor指令的页面。
问题:刷新浏览器,从A跳进B后,想返回A有两种方法,一是$state.go('A'),二是history.back(),但无论哪个方法,第一次想返回A都无法调用一次就返回成功,$state.go('A')要执行两次才能回去,history.back()要执行三次才行...
注意:是“刷新浏览器后第一次” 从B返回A。执行两次$state.go('A')或三次history.back()成功回到A后再回B再返回A就没问题的,一定要刷新页面才可以重现出来...
我引用你这个做的项目,但是js引用ueditor.config.js和ueditor.all.js用本地的就不行,而且图片也上传不上去
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.