diff --git a/bower.json b/bower.json index 5c71c3d..5dcd286 100644 --- a/bower.json +++ b/bower.json @@ -1,6 +1,6 @@ { "name": "ng-remote-validate", - "version": "0.6.1", + "version": "0.6.1.1", "description": "ngRemoveValidate makes it easy for you to validate form fields agents data from your server (AngularJS Ajax Validation).", "main": "release/ngRemoteValidate.js", "keywords": [ diff --git a/gulpfile.js b/gulpfile.js new file mode 100644 index 0000000..97ad97d --- /dev/null +++ b/gulpfile.js @@ -0,0 +1,27 @@ +var gulp = require('gulp'); +var uglify = require('gulp-uglify'); +var rename = require("gulp-rename"); +var ngAnnotate = require('gulp-ng-annotate'); +var replace = require('gulp-replace'); + +var pkg = require('./package.json'); + +gulp.task('default', function() { + return gulp.src('src/*.js') + .pipe(replace(/##_version_##/g, pkg.version)) + .pipe(ngAnnotate()) + .pipe(gulp.dest('release')) + .pipe(uglify()) + .pipe(rename({ + extname: '.min.js' + })) + .pipe(gulp.dest('release')); + +}); + +gulp.task('bower', function() { + return gulp.src('bowerTemplate.json') + .pipe(replace(/##_version_##/g, pkg.version)) + .pipe(rename('bower.json')) + .pipe(gulp.dest('.')); +}); diff --git a/package.json b/package.json new file mode 100644 index 0000000..c80031c --- /dev/null +++ b/package.json @@ -0,0 +1,16 @@ +{ + "name": "ng-remote-validate", + "description": "makes it easy for you to validate form fields agents data from your server. For example, a sign up form may need to check if the email entered is already registered before submitting the form.", + "version": "0.6.1.1", + "devDependencies": { + "gulp": "^3.8.11", + "gulp-ng-annotate": "^0.5.2", + "gulp-rename": "^1.2.2", + "gulp-replace": "^0.5.3", + "gulp-uglify": "^1.2.0" + }, + "repository": { + "type": "git", + "url": "https://github.com/azatoth/ng-remote-validate.git" + } +} diff --git a/release/ngRemoteValidate.js b/release/ngRemoteValidate.js index ddf0983..8ee7c26 100644 --- a/release/ngRemoteValidate.js +++ b/release/ngRemoteValidate.js @@ -124,8 +124,8 @@ toValidate = { value: value }, httpOpts = { method: options.ngRemoteMethod }; - if ( scope[ el[0].name + 'SetArgs' ] ) { - toValidate = scope[el[0].name + 'SetArgs'](value, el, attrs, ngModel); + if ( scope.$parent[ el[0].name + 'SetArgs' ] ) { + toValidate = scope.$parent[el[0].name + 'SetArgs'](value, el, attrs, ngModel); } if(options.ngRemoteMethod == 'POST'){ @@ -159,7 +159,7 @@ }; angular.module( 'remoteValidation', [] ) - .constant('MODULE_VERSION', '0.6.1') + .constant('MODULE_VERSION', '0.6.1.1') .directive( directiveId, [ '$http', '$timeout', '$q', remoteValidate ] ); -})( this.angular ); \ No newline at end of file +})( this.angular ); diff --git a/src/ngRemoteValidate.js b/src/ngRemoteValidate.js index 0b6a1c9..0caebf3 100644 --- a/src/ngRemoteValidate.js +++ b/src/ngRemoteValidate.js @@ -124,8 +124,8 @@ toValidate = { value: value }, httpOpts = { method: options.ngRemoteMethod }; - if ( scope[ el[0].name + 'SetArgs' ] ) { - toValidate = scope[el[0].name + 'SetArgs'](value, el, attrs, ngModel); + if ( scope.$parent[ el[0].name + 'SetArgs' ] ) { + toValidate = scope.$parent[el[0].name + 'SetArgs'](value, el, attrs, ngModel); } if(options.ngRemoteMethod == 'POST'){ @@ -162,4 +162,4 @@ .constant('MODULE_VERSION', '##_version_##') .directive( directiveId, [ '$http', '$timeout', '$q', remoteValidate ] ); -})( this.angular ); \ No newline at end of file +})( this.angular );