i am searching on internet then found many missing thing on validation on form when you are beginner and learning in angular js
I am follow few step of validation of angular js then validate my form. validation script
I am follow few step of validation of angular js then validate my form. validation script
var d = angular.module('myapp', []); d.controller('HomeController', function($scope) { $scope.loginForm = { UserName: '', password: '', email: '', Gender: [{ value: 0, text: '--select--' }, { value: 1, text: 'Male' }, { value: 2, text: 'female' }] } $scope.form = $scope.loginForm.Gender[0].value $scope.validate = function(model) { $scope.form1.$submitted = true; $scope.selectedGender = document.getElementById('ddlGender').value == '0' if ($scope.selectedGender) { return false; } if ($scope.form1.$valid) alert(1); } $scope.onSelectChange = function() { $scope.selectedGender = document.getElementById('ddlGender').value == '0' } })