@@ -38,7 +38,7 @@ myApp.controller('Ctrl', ['$location', '$route', '$scope', '$translate', functio
3838
3939// -- Controller to use Angular-Validation Directive
4040// -----------------------------------------------
41- myApp . controller ( 'CtrlValidationDirective' , [ '$q' , '$scope' , 'validationService ' , function ( $q , $scope , validationService ) {
41+ myApp . controller ( 'CtrlValidationDirective' , [ '$q' , '$scope' , 'ValidationService ' , function ( $q , $scope , ValidationService ) {
4242 // you can change default debounce globally
4343 $scope . $validationOptions = { debounce : 1500 , preValidateFormElements : false } ;
4444
@@ -49,13 +49,13 @@ myApp.controller('CtrlValidationDirective', ['$q', '$scope', 'validationService'
4949 // remove a single element ($scope.form1, string)
5050 // OR you can also remove multiple elements through an array type .removeValidator($scope.form1, ['input2','input3'])
5151 $scope . removeInputValidator = function ( elmName ) {
52- new validationService ( ) . removeValidator ( $scope . form1 , elmName ) ;
52+ new ValidationService ( ) . removeValidator ( $scope . form1 , elmName ) ;
5353 } ;
5454 $scope . resetForm = function ( ) {
55- new validationService ( ) . resetForm ( $scope . form1 ) ;
55+ new ValidationService ( ) . resetForm ( $scope . form1 ) ;
5656 } ;
5757 $scope . submitForm = function ( ) {
58- if ( new validationService ( ) . checkFormValidity ( $scope . form1 ) ) {
58+ if ( new ValidationService ( ) . checkFormValidity ( $scope . form1 ) ) {
5959 alert ( 'All good, proceed with submit...' ) ;
6060 }
6161 }
@@ -83,11 +83,11 @@ myApp.controller('CtrlValidationDirective', ['$q', '$scope', 'validationService'
8383// -- Controller to use Angular-Validation Directive with 2 forms
8484// on this page we will pre-validate the form and show all errors on page load
8585// ---------------------------------------------------------------
86- myApp . controller ( 'Ctrl2forms' , [ 'validationService ' , function ( validationService ) {
86+ myApp . controller ( 'Ctrl2forms' , [ 'ValidationService ' , function ( ValidationService ) {
8787 var vm = this ; // use the ControllerAs alias syntax
8888
8989 // set the global options BEFORE any function declarations, we will prevalidate current form
90- var myValidationService = new validationService ( { controllerAs : vm , debounce : 500 , preValidateFormElements : true } ) ;
90+ var myValidationService = new ValidationService ( { controllerAs : vm , debounce : 500 , preValidateFormElements : true } ) ;
9191
9292 vm . submitForm = function ( ) {
9393 if ( myValidationService . checkFormValidity ( vm . form01 ) ) {
@@ -106,9 +106,9 @@ myApp.controller('Ctrl2forms', ['validationService', function (validationService
106106// -----------------------------------------------
107107
108108// exact same testing form used except that all validators are programmatically added inside controller via Angular-Validation Service
109- myApp . controller ( 'CtrlValidationService' , [ '$q' , '$scope' , '$translate' , 'validationService ' , function ( $q , $scope , $translate , validationService ) {
109+ myApp . controller ( 'CtrlValidationService' , [ '$q' , '$scope' , '$translate' , 'ValidationService ' , function ( $q , $scope , $translate , ValidationService ) {
110110 // start by creating the service
111- var myValidation = new validationService ( ) ;
111+ var myValidation = new ValidationService ( ) ;
112112
113113 // you can create indepent call to the validation service
114114 // also below the multiple properties available
@@ -183,7 +183,7 @@ myApp.controller('CtrlValidationService', ['$q', '$scope', '$translate', 'valida
183183
184184// -- Controller to use Angular-Validation with Directive and ngRepeat
185185// ---------------------------------------------------------------
186- myApp . controller ( 'CtrlNgRepeat' , [ '$scope' , 'validationService ' , function ( $scope , validationService ) {
186+ myApp . controller ( 'CtrlNgRepeat' , [ '$scope' , 'ValidationService ' , function ( $scope , ValidationService ) {
187187 // Form data
188188 $scope . people = [
189189 { name : 'John' , age : 20 } ,
@@ -192,7 +192,7 @@ myApp.controller('CtrlNgRepeat', ['$scope', 'validationService', function ($scop
192192 ] ;
193193
194194 $scope . submitForm = function ( ) {
195- if ( new validationService ( ) . checkFormValidity ( $scope . form01 ) ) {
195+ if ( new ValidationService ( ) . checkFormValidity ( $scope . form01 ) ) {
196196 alert ( 'All good, proceed with submit...' ) ;
197197 }
198198 }
0 commit comments