Angularjs 传递引用以形成在角度方向上应用指令的组件

Angularjs 传递引用以形成在角度方向上应用指令的组件,angularjs,forms,model,components,directive,Angularjs,Forms,Model,Components,Directive,我必须在我的一个控制器方法中访问$error属性。我是这样做的: <input name="myinput" my-directive="{{doSomethingWith(myform.myinput)}}" // other /> 其中,$element是doSomethingWith方法所需的参数名称。能否共享指令定义。属性值可以是my directive=doSomethingWithmyform.myinputNo,然后将其视为普通文本。必须将其

我必须在我的一个控制器方法中访问$error属性。我是这样做的:

<input name="myinput"
       my-directive="{{doSomethingWith(myform.myinput)}}"
      // other
/>

其中,$element是doSomethingWith方法所需的参数名称。

能否共享指令定义。属性值可以是my directive=doSomethingWithmyform.myinputNo,然后将其视为普通文本。必须将其包裹在支架内。该指令不是我的-它来自引导角组件-请检查数据工具提示html不安全指令。但我不认为它会有帮助,因为它可以在其他元素上工作。
Can't interpolate {{doSomethingWith(myform.myinput)}} TypeError: $element is undefined