diff --git a/package.json b/package.json index 52674426..21dd8d46 100644 --- a/package.json +++ b/package.json @@ -15,7 +15,7 @@ ], "dependencies": { "admin-config": "~0.12.1", - "angular": "~1.5.11", + "angular": "~1.6.1", "angular-numeraljs": "^1.1.6", "angular-sanitize": "^1.3.15", "angular-translate": "^2.11.0", diff --git a/src/javascripts/ng-admin/Main/MainModule.js b/src/javascripts/ng-admin/Main/MainModule.js index c56752b6..25e0af81 100644 --- a/src/javascripts/ng-admin/Main/MainModule.js +++ b/src/javascripts/ng-admin/Main/MainModule.js @@ -19,6 +19,7 @@ MainModule.directive('maMenuBar', require('./component/directive/maMenuBar')); MainModule.config(require('./config/http')); MainModule.config(require('./config/routing')); MainModule.config(require('./config/translate')); +MainModule.config(require('./config/location')); MainModule.run(require('./run/HttpErrorHandler')); MainModule.run(require('./run/Loader')); diff --git a/src/javascripts/ng-admin/Main/config/location.js b/src/javascripts/ng-admin/Main/config/location.js new file mode 100644 index 00000000..016342b9 --- /dev/null +++ b/src/javascripts/ng-admin/Main/config/location.js @@ -0,0 +1,10 @@ +const location = ($locationProvider) => { + // Keep the start of all routes to #/ instead of #!/ + // while updating to Angular 1.6 + // @see https://docs.angularjs.org/guide/migration#commit-aa077e8 + $locationProvider.hashPrefix(''); +}; + +location.$inject = ['$locationProvider']; + +export default location; diff --git a/src/javascripts/test/unit/Crud/field/maCheckboxFieldSpec.js b/src/javascripts/test/unit/Crud/field/maCheckboxFieldSpec.js index f1f9ae81..4e536640 100644 --- a/src/javascripts/test/unit/Crud/field/maCheckboxFieldSpec.js +++ b/src/javascripts/test/unit/Crud/field/maCheckboxFieldSpec.js @@ -36,9 +36,9 @@ describe('directive: checkbox-field', function () { scope.value = true; var element = $compile(directiveUsage)(scope); scope.$digest(); - expect(element.find('input').attr('checked')).toBeTruthy(); + expect(element[0].querySelector(':checked')).toBeTruthy(); scope.value = false; scope.$digest(); - expect(element.find('input').attr('checked')).toBeFalsy(); + expect(element[0].querySelector(':checked')).toBeFalsy(); }); });