0
return {
restrict: 'E',
replace: true,
transclude: true,
require: ['^?angular-redactor', '^?ngModel'],
scope: {
options: '='
},
template: `<div ng-if="options.type=='redactor'">
<textarea
id="{{options.id}}"
ng-model="ngModel"
ng-disabled="!hasPermission('editPageTitle')"
height="{{options.height}}"
style="{{options.style}}"
redactor="{{options.config}}">
</textarea>
</div>`
}
HTML
<txt ng-model="title"
options="{
type: 'redactor',
id: 'title-input',
height: '26px',
style: 'resize:none; max-height: 32px' ,
config: {
minHeight: 37
}
}">
</txt>
我得到的結果NG-模型= 「ngModel」,而不是NG-模型= 「稱號」。我嘗試將模板ng-model =「ngModel」更改爲ng-model =「{{ngModel}}」。但它沒有奏效。不知道爲什麼。
沒有傷心地工作。輸出只是'ng-model =「bindModel」'而不是所需的'ng-model =「標題」' –