我有这个 html 标记:
<div data-ng-controller="VehicleProfileController">
<modal title="Add Vehicle Info" visible="showVehicleInfo">
<div class="container">
<div class="col-xs-4">
<div class="row">
Title <input type="text" ng-model="NewVMPTitle" class="form-control"/>
Miles <input type="text" ng-model="NewVMPMiles" class="form-control"/>
</div>
<div class="row">
<button ng-click="addVehicleData()" class="btn btn-success pull-right">Save</button>
</div>
</div>
</div>
</modal>
</div>
然后在控制器中我有这个:
$scope.addVehicleData = function () {
alert($scope.NewVMPTitle + ' ' + $scope.NewVMPMiles);
};
NEWVMPTitle 和 NewVPMMiles 都是空的,我错过了什么吗?