AngularJS check if form is valid in controller

前端 未结 4 1710
花落未央
花落未央 2020-12-02 11:39

I need to check if a form is valid in a controller.

View:

4条回答
  •  我在风中等你
    2020-12-02 12:14

    I have updated the controller to:

    .controller('BusinessCtrl',
        function ($scope, $http, $location, Business, BusinessService, UserService, Photo) {
            $scope.$watch('createBusinessForm.$valid', function(newVal) {
                //$scope.valid = newVal;
                $scope.informationStatus = true;
            });
            ...
    

提交回复
热议问题