无法通过$ scope访问我的表单,但可以在此处看到

时间:2018-06-20 10:15:07

标签: javascript html angularjs forms angularjs-scope

我想将$ error字段设置为$ touched,但是我注意到即使我在console.log $scope.vm.InwardLeaseForm上也能看到它,但我无法访问$scope

$scope.vm.InwardLeaseFormvm.InwardLeaseForm都返回未定义。 这是我的表格

<div class="col-xs-12 btm40">
<h2 class="subHead">Lease Details</h2>
<div>
    <form name="vm.InwardLeaseForm" ng-submit="vm.saveInwardLeasingForm()" novalidate>
        <formly-form model="vm.InwardLeaseModel" fields="vm.InwardLeaseFields"
                     options="vm.InwardLeaseOptions" form="vm.InwardLeaseForm"></formly-form>
        <div class="top20">
            <button class="btn btn-primary" type="submit" ng-hide="vm.vehicleLockedFlag || vm.acquisitionCancelledFlag">Save</button>
        </div>
    </form>
</div>

如您所见,它出现在$scope

enter image description here

0 个答案:

没有答案