<input class =“form-control”type =“text”ng-model =“NewProduct.Name”/>

时间:2018-05-11 20:19:26

标签: javascript angularjs

即使鼠标不受影响,我的输入表格根本无法正常工作 这是代码:

<div id="product-page" ng-controller="ProductCtrl" ng-init="init()">

<form class="col-md-6">
    <div class="form-group">
        <label class="col-md-4">NAME:</label>
        <div class="col-md-8">
            <input class="form-control" type="text" ng-model="NewProduct.Name"/>
        </div>
    </div>
    <div class="form-group">
        <label class="col-md-4">SURNAME :</label>
        <div class="col-md-8">
            <input type="text" class="form-control" ng-model="NewProduct.Surname"/>
        </div>

    </div>
    <div class="form-group">
        <label class="col-md-4">PRODUCT:</label>
        <div class="col-md-8">
            <input type="text" class="form-control" ng-model="NewProduct.Name" ng-options="product.id as product.name for product in Products"/>
        </div>
    </div>
    <div class="col-md-12">
        <div class="right">
            <button type="submit" class="btn btn-default" ng-click="Save()">Submit</button>
        </div>
    </div>
</form>
<div class="clearfix"></div>

我在这里没有看到错误 也许然后在js代码中:

CoffeeApp.controller('ProductCtrl', ['$scope', function ($scope)
{
    $scope.Products;

    $scope.GetProducts = function () {
        $.post('/Product/GetProducts', function (data) {
            console.log(data);
            $scope.Products = data;
        });
    };
}]);

0 个答案:

没有答案