@@ -168,7 +168,7 @@ formus.directive('formusField', function($injector, $http, $compile, $log, $temp
168
168
$scope . isValid = true ;
169
169
$scope . dirty = false ;
170
170
$scope . validation = function ( value ) {
171
- if ( _ . isObject ( $scope . config . validators ) ) {
171
+ if ( angular . isObject ( $scope . config . validators ) ) {
172
172
$scope . errors = [ ] ;
173
173
angular . forEach ( $scope . config . validators , function ( args , name ) {
174
174
var error = FormusValidator . validate ( name , value , $scope . config , args ) ;
@@ -191,7 +191,7 @@ formus.directive('formusField', function($injector, $http, $compile, $log, $temp
191
191
192
192
var init = function ( ) {
193
193
$scope . parentCtrl = $element . parent ( ) . controller ( 'formus-field' ) ;
194
- if ( _ . isUndefined ( $scope . parentCtrl ) ) {
194
+ if ( angular . isUndefined ( $scope . parentCtrl ) ) {
195
195
$scope . parentCtrl = $element . parent ( ) . controller ( 'formus-form' ) ;
196
196
}
197
197
$scope . parentScope = $scope . parentCtrl . getScope ( ) ;
@@ -219,7 +219,7 @@ formus.directive('formusField', function($injector, $http, $compile, $log, $temp
219
219
}
220
220
} ) ;
221
221
222
- $scope . isParent = ( ! _ . isUndefined ( $scope . config . fields ) ) ;
222
+ $scope . isParent = ( ! angular . isUndefined ( $scope . config . fields ) ) ;
223
223
/** Set field type 'fieldset' when it has child fields and don't set other type */
224
224
if ( $scope . isParent && ( _ . isUndefined ( $scope . config . input ) ) ) {
225
225
$scope . config . input = 'fieldset' ;
@@ -230,7 +230,7 @@ formus.directive('formusField', function($injector, $http, $compile, $log, $temp
230
230
$element : $element ,
231
231
$attr : $attr
232
232
} ) ;
233
- if ( _ . isFunction ( $scope . config . linker ) ) {
233
+ if ( angular . isFunction ( $scope . config . linker ) ) {
234
234
$injector . invoke ( $scope . config . linker , this , {
235
235
$scope : $scope ,
236
236
$element : $element ,
@@ -324,7 +324,7 @@ formus.directive('formusForm', function($q, FormusLinker, FormusTemplates, Formu
324
324
} ;
325
325
$scope . submit = function ( ) {
326
326
$scope . validate ( ) . then ( function ( ) {
327
- if ( typeof ( $scope . config . submit . handler ) === 'function' ) {
327
+ if ( angular . isFunction ( $scope . config . submit . handler ) ) {
328
328
$scope . config . submit . handler ( ) ;
329
329
}
330
330
} , angular . noop ) ;
@@ -548,7 +548,7 @@ formus.provider('FormusLinker', function() {
548
548
$scope . setElementTemplate = function ( templateData ) {
549
549
$element . html ( templateData ) ;
550
550
$compile ( $element . contents ( ) ) ( $scope ) ;
551
- if ( typeof ( $scope . afterLoadTemplate ) === 'function' ) {
551
+ if ( angular . isFunction ( $scope . afterLoadTemplate ) ) {
552
552
$scope . afterLoadTemplate ( ) ;
553
553
}
554
554
} ;
@@ -591,7 +591,7 @@ formus.provider('FormusLinker', function() {
591
591
$scope . config [ name ] = value ;
592
592
}
593
593
} ) ;
594
- if ( ( $scope . config . label ) && ( typeof ( $scope . config . showLabel ) === 'undefined' ) ) {
594
+ if ( ( $scope . config . label ) && angular . isUndefined ( $scope . config . showLabel ) ) {
595
595
$scope . config . showLabel = true ;
596
596
}
597
597
} ;
@@ -669,7 +669,7 @@ formus.provider('FormusTemplates', function() {
669
669
* @param templateUrl
670
670
*/
671
671
var setTemplateUrl = function ( name , templateUrl ) {
672
- if ( typeof name === 'string' ) {
672
+ if ( angular . isString ( name ) ) {
673
673
templateMap [ name ] = templateUrl ;
674
674
} else {
675
675
angular . forEach ( name , function ( templateUrl , name ) {
@@ -804,7 +804,7 @@ formus.provider('FormusValidator', function($logProvider) {
804
804
} ;
805
805
} ;
806
806
var set = function ( name , callback ) {
807
- if ( typeof ( callback ) === 'function' ) {
807
+ if ( angular . isFunction ( callback ) ) {
808
808
validators [ name ] = callback ;
809
809
} else {
810
810
$logProvider . warn ( 'Validator must be function. Can\'t set validator with name "' + name + '"' ) ;
0 commit comments