我试图通过单击按钮来传递输入文本框的值
<script>
var h = this.scope.myHot;
//var c = {{cold}};
var value = h;
// or overwrite value in your callback function ...
this.scope.action = function() { return value; }
</script>
<p>Hot: <input type="text" ng-model="hot" ng-value="myHot"></p>
<p>Cold: <input type="text" ng-model="cold"></p>
<md-button ng-click="send({payload:action()})">
Click me
</md-button>
答案 0 :(得分:0)
如果只想将角度模型值发送回节点红色流,则可以将ui_template
节点与一些通用ng代码一起使用,如下所示:
<p>Hot: <input type="text" ng-model="myHot"></p>
<p>Cold: <input type="text" ng-model="myCold"></p>
<md-button ng-click="send({payload: {hot: myHot, cold: myCold}})">
Send values
</md-button>
返回的msg.payload
对象将包含使用以下结构在热输入字段和冷输入字段中输入的所有值:
{"hot":"123","cold":"4.5"}