Warning: file_get_contents(/data/phpspider/zhask/data//catemap/9/javascript/455.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Javascript 不与角度变量绑定的表单输入_Javascript_Html_Angularjs_Ionic Framework - Fatal编程技术网

Javascript 不与角度变量绑定的表单输入

Javascript 不与角度变量绑定的表单输入,javascript,html,angularjs,ionic-framework,Javascript,Html,Angularjs,Ionic Framework,我试图通过Angular自动发送表单,并将输入值与控制器中的变量绑定。然而,由于某些原因,这些价值未被确认 <ion-view cache-view="false" ng-controller="CashierController as cashCtrl" class="background"> <ion-nav-title></ion-nav-title> <ion-content padding="true"> <fo

我试图通过Angular自动发送表单,并将输入值与控制器中的变量绑定。然而,由于某些原因,这些价值未被确认

<ion-view cache-view="false" ng-controller="CashierController as cashCtrl" class="background">
  <ion-nav-title></ion-nav-title>

  <ion-content padding="true">

    <form id="cashier" name="cashCtrl.cashierForm" method="POST" action="https://url.action" target="screen">
      <input type='hidden' id='token' name='token' ng-model="cashCtrl.token" />
      <input type='hidden' id='merchantId' name='merchantId' ng-model="cashCtrl.merchantId" />
      <input type='hidden' id='customerId' name='customerId' ng-model="cashCtrl.customerId" />
      <input type='hidden' id='action' name='action' ng-model="cashCtrl.action" />
      <input type='hidden' id='paysolName' name='paysolName' ng-model="cashCtrl.paysolName" />
    </form>

    <iframe name="screen" height=600 width=320>
    </iframe>

  </ion-content>
</ion-view>
值得注意的是,如果我使用花括号表示法指定变量,如:
{{{cashCtrl.token}
,但不在表单上,则会显示绑定的值。此外,行
console.log(this.cashierForm)返回未定义的


我做错了什么?

ng model
没有为
隐藏的
输入字段设置值。在这种情况下,我如何绑定到隐藏字段?我想这个链接回答了一个问题,您可以执行类似
var self=this的操作执行此操作后,为什么要再次使用
?与问题无关,但只是一个建议
ng model
没有为
隐藏的
输入字段设置值。在这种情况下,我如何绑定到隐藏字段?我认为此链接回答了问题,您可以执行类似
var self=this的操作执行此操作后,为什么要再次使用
?与问题无关,只是一个建议
var app = angular.module('app');

app.controller('CashierController', function($scope, $state, $window, $localStorage, GatewayService) {

  var self = this;

  this.cashierUrl = "https://url.action";
  this.token = $localStorage.cashierToken;
  this.merchantId = '//';
  this.customerId = $localStorage.customerId;
  this.action = '//';
  this.paysolName = 'CreditDebitCards';

  console.log(this.cashierForm);

  document.getElementById('cashier').submit();

  this.goToPage = function(page) {
    $state.go(page);
  }

})