gpt4 book ai didi

html - 无法在 'setStart' : parameter 1 is not of type 'Range' issue while using @mentio more than one in a page? 上执行 'Node'

转载 作者:搜寻专家 更新时间:2023-10-31 08:51:58 25 4
gpt4 key购买 nike

我将 textAngular Wysiwyg/Text-Editor 与@mentio 库一起使用,当我在一个 html 页面中使用多个指令时,它会导致问题。我尝试使用 context-editor for mention id 仍然无法解决问题

<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}}'");
};

最佳答案

我解决这个问题的方法是编写一个函数来返回 mentio-for 值。

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

然后,在你的指令中,创建一个像这样的函数:

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

关于html - 无法在 'setStart' : parameter 1 is not of type 'Range' issue while using @mentio more than one in a page? 上执行 'Node',我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/40655115/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com