角度范围继承 - 如何使用指令的封闭范围

时间:2014-03-25 18:17:39

标签: angularjs angularjs-scope

我已经获得了WYSIWYG组件。我正在尝试将它集成到一个表单中 - 我无法在指令和封闭控制器之间传递值。为什么?

<span ng-controller="testerctrl">

<wysiwyg textarea-id="question" textarea-class="form-control"  textarea-height="280px" textarea-name="textareaQuestion" textarea-required ng-model="myvaries" enable-bootstrap-title="false">

    '<div id="{{textareaId}}" style="resize:vertical;height:{{textareaHeight || \'80px\'}}; overflow:auto" contentEditable="true" class="{{textareaClass}} wysiwyg-textarea" rows="{{textareaRows}}" name="{{textareaName}}" required="{{textareaRequired}}" placeholder="{{textareaPlaceholder}}" ng-model="value"></div>' +
      '</div>',
    restrict: 'E',
    scope:{
  value: '=ngModel',
  textareaHeight: '@textareaHeight',
  textareaName: '@textareaName',
  textareaPlaceholder: '@textareaPlaceholder',
  textareaClass: '@textareaClass',
  textareaRequired: '@textareaRequired',
  textareaId: '@textareaId',
},


function($scope){

$scope.myvaries="val"


}

0 个答案:

没有答案