我使用ng-repeat的textangular编辑器。
html中的 <ul ng-repeat="lecture in section.lectures">
<div class="col-md-12 article-show" >
<form ng-submit="lecture_content('article',$index+1,lecture.id)" style="width:100%;">
<div text-angular id="lecture_text{{lecture.id}}" ng-model="htmlVariable[lecture.id]" style="width:100%;" ></div>
<button type="submit" data-toggle="modal" data-target="#stext" class="sub-sub-section-add">Submit</button>
</form>
</div>
</ul>
$scope.lecture_content=function(type,value,x)
{
if(type=='article')
{
console.log($scope.htmlVariable[lecture.id]);
lecture_description=document.getElementById('lecture_text'+x).value;
}
我认为问题出在控制器部分。如何在文本编辑器中访问值?提前谢谢。
答案 0 :(得分:0)
$scope.lecture_content=function(type,value,x)
{
if (type == 'article')
{
var x = this.htmlVariable[id];
}