2016-11-17 2 views
3

私は、問題を引き起こしている複数のHTMLページに複数の指示文を使用しているときに、@mentioライブラリでtextAngular Wysiwyg/Text-Editorを使用しています。私はこの問題を解決する方法はmentio-の値を​​返す関数を書くことによってだった問題'Range'に 'setStart'を実行できませんでした:ページ内に複数の@mentioを使用しているときに、パラメータ1のタイプが「ノード」の問題ではありませんか?

<mentio-menu mentio-for="'content-editor-{{$id}}'" 
     mentio-trigger-char="'@'" 
     mentio-items="people" 
     mentio-template-url="/iterator.tpl" 
     mentio-search="searchPeople(term)" 
     mentio-select="getPeopleText(item)"> 

var directiveDefinitionObject = { 
     restrict: 'E', 
     templateUrl: "app/partials/textAngular-mention-template/replyTextAngularWithMentio.html", 
     require: '^ngModel', 
     scope: { 
      ngModel: '=' 
     }, 
     controller: ['$scope', function ($scope) { 
       $scope.setup = function (element) { 
        element.attr('mentio', 'mentio'); 
        element.attr('mentio-typed-term', 'typedTerm'); 
        element.attr('mentio-require-leading-space', 'true'); 
        element.attr('mentio-id', "'content-editor-{{$id}}'"); 
       }; 

答えて

0

に解決できませんでした、まだ言及IDのコンテキスト・エディタを使用してみました。

$scope.getContentId = function() { 
       return 'content-editor-' + $scope.id; 
      }; 

<mentio-menu mentio-for="getContentId()" 
    mentio-trigger-char="'@'" 
    mentio-items="people" 
    mentio-template-url="/iterator.tpl" 
    mentio-search="searchPeople(term)" 
    mentio-select="getPeopleText(item)"> 

次に、あなたの指示に、このような関数を作成します

関連する問題