angular.js - AngularJS 表单验证
phpcn_u1582
phpcn_u1582 2017-05-15 16:54:24
0
3
434

我的AngularJs版本是v1.4.3,在做表单验证时,遇到了问题。
我希望达到的效果是:当表单内容为空时,登录按钮禁用。但现在是登录按钮没有被禁用。

-- HTML --

-- AngularJS --

var app=angular.module("ayApp",[]); app.controller("ayAppCtrl",['$scope',function($scope){ var vm=$scope.vm={}; vm.d=storedb('ay').find(); vm.submit=function(sign_form){ sign_form.$setDirty(); if(sign_form.$valid){ alert("Success"); } } }]);
phpcn_u1582
phpcn_u1582

reply all (3)
滿天的星座

    我想大声告诉你

    A vm object is bound to the scope, and then you create a vm. What do you want to do?
    Secondly, I don’t think you need to write a controller yourself to implement this function.

      Latest Downloads
      More>
      Web Effects
      Website Source Code
      Website Materials
      Front End Template
      About us Disclaimer Sitemap
      php.cn:Public welfare online PHP training,Help PHP learners grow quickly!