Warning: file_get_contents(/data/phpspider/zhask/data//catemap/1/angularjs/24.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Twitter bootstrap Angularjs引导WYSIHTML5编辑器_Twitter Bootstrap_Angularjs_Wysihtml5 - Fatal编程技术网

Twitter bootstrap Angularjs引导WYSIHTML5编辑器

Twitter bootstrap Angularjs引导WYSIHTML5编辑器,twitter-bootstrap,angularjs,wysihtml5,Twitter Bootstrap,Angularjs,Wysihtml5,我在执行此指令时遇到问题: 我不断得到类型错误:无法调用未定义的错误的方法“setValue” 这是我的建议: 您需要在代码中包含wysihtml5-0.3.0.min.js现在我收到了这个错误:TypeError:无法调用未定义的方法“setValue”您能更新plunk吗?尝试使用旧版本的wysihtml5(引导示例中使用的是什么?)尝试替换$scope.editor.composer.setValue(newValue)by$scope.editor.data('wysihtml5').

我在执行此指令时遇到问题:

我不断得到类型错误:无法调用未定义的错误的方法“setValue”

这是我的建议:

您需要在代码中包含wysihtml5-0.3.0.min.js

现在我收到了这个错误:TypeError:无法调用未定义的方法“setValue”您能更新plunk吗?尝试使用旧版本的wysihtml5(引导示例中使用的是什么?)尝试替换
$scope.editor.composer.setValue(newValue)
by
$scope.editor.data('wysihtml5').editor.composer.setValue(newValue)错误消息确实消失了,但是现在如何获取编辑器的内容?因为我尝试在控制台中记录一些东西来检查watch功能,但它只记录了一次(在开始时),我以前从未使用过wysihtml5,所以这并不容易。但是看看源代码和chrome调试器。我在控制器中添加了一个由按钮触发的
$scope.alertValue=function(){alert($scope.editor.getValue());}
,以及一个
$scope.logValue=function(html){console.log(html);}也在控制器中起作用,以便在编辑器每次失去焦点时记录其内容。我还添加了一个ng模型属性,以便能够在变量中启动并保存textarea。