Skip to content
This repository has been archived by the owner on Sep 4, 2019. It is now read-only.

Commit

Permalink
Correct injection for validationService.
Browse files Browse the repository at this point in the history
Facilitate minified testing.
  • Loading branch information
mdekrey committed Apr 5, 2015
1 parent 566c934 commit cd303f1
Show file tree
Hide file tree
Showing 7 changed files with 14 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
restrict: string = 'A';
require: string = 'ngModel';
private validation: ValidationService;

constructor(validation: ValidationService) {
this.validation = validation;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,7 @@
delete this.ensureValidation(scope).data[dotNetName];
}

static $inject = ['$injector','$sce','getValidationType'];
constructor($injector: ng.auto.IInjectorService, $sce: IMySCEService, getValidationType: (keyName: string) => ValidationType) {
this.$injector = $injector;
this.$sce = $sce;
Expand Down
10 changes: 8 additions & 2 deletions ResponsivePath.Validation.Scripts/gruntfile.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,13 +3,19 @@ module.exports = function (grunt) {
grunt.initConfig({
uglify: {
scripts: {
files: { '../js/angular.unobtrusive.validation.min.js': ['../js/angular.unobtrusive.validation.js'] },
files: {
'../js/angular.unobtrusive.validation.min.js': ['../js/angular.unobtrusive.validation.js'],
'wwwroot/Scripts/angular.unobtrusive.validation.min.js': ['wwwroot/Scripts/angular.unobtrusive.validation.js'],
},
options: {
sourceMap: true,
}
},
templates: {
files: { '../js/angular.unobtrusive.validation.tpls.min.js': ['../js/angular.unobtrusive.validation.tpls.js'] },
files: {
'../js/angular.unobtrusive.validation.tpls.min.js': ['../js/angular.unobtrusive.validation.tpls.js'],
'wwwroot/Scripts/angular.unobtrusive.validation.tpls.min.js': ['wwwroot/Scripts/angular.unobtrusive.validation.tpls.js'],
},
options: {
sourceMap: true,
}
Expand Down
1 change: 1 addition & 0 deletions js/angular.unobtrusive.validation.js
Original file line number Diff line number Diff line change
Expand Up @@ -546,6 +546,7 @@ var ResponsivePath;
delete this.ensureValidation(scope).messages[dotNetName];
delete this.ensureValidation(scope).data[dotNetName];
};
ValidationService.$inject = ['$injector', '$sce', 'getValidationType'];
return ValidationService;
})();
Unobtrusive.ValidationService = ValidationService;
Expand Down
2 changes: 1 addition & 1 deletion js/angular.unobtrusive.validation.min.js

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion js/angular.unobtrusive.validation.min.js.map

Large diffs are not rendered by default.

1 change: 1 addition & 0 deletions typings/angular.unobtrusive.validation.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -106,6 +106,7 @@ declare module ResponsivePath.Validation.Unobtrusive {
hasCancelledSuppress: (scope: ng.IScope) => boolean;
cancelSuppress(scope: ng.IScope): void;
clearDotNetName(scope: ng.IScope, dotNetName: string): void;
static $inject: string[];
constructor($injector: ng.auto.IInjectorService, $sce: IMySCEService, getValidationType: (keyName: string) => ValidationType);
}
}
Expand Down

0 comments on commit cd303f1

Please sign in to comment.