Skip to content

Commit

Permalink
Revert "replaced var with let or const"
Browse files Browse the repository at this point in the history
This reverts commit 38c33ac
  • Loading branch information
eninja committed Jun 5, 2018
1 parent c396af2 commit 4280859
Show file tree
Hide file tree
Showing 8 changed files with 20 additions and 20 deletions.
4 changes: 2 additions & 2 deletions spring-petclinic-client/src/scripts/app.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
'use strict';
/* App Module */
const petClinicApp = angular.module('petClinicApp', [
var petClinicApp = angular.module('petClinicApp', [
'ui.router', 'infrastructure', 'layoutNav', 'layoutFooter', 'layoutWelcome',
'ownerList', 'ownerDetails', 'ownerForm', 'petForm', 'visits', 'vetList']);

Expand Down Expand Up @@ -28,7 +28,7 @@ petClinicApp.config(['$stateProvider', '$urlRouterProvider', '$locationProvider'
}]);

['welcome', 'nav', 'footer'].forEach(function(c) {
const mod = 'layout' + c.toUpperCase().substring(0, 1) + c.substring(1);
var mod = 'layout' + c.toUpperCase().substring(0, 1) + c.substring(1);
angular.module(mod, []);
angular.module(mod).component(mod, {
templateUrl: "scripts/fragments/" + c + ".html"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,11 +7,11 @@ angular.module('infrastructure')
.factory('HttpErrorHandlingInterceptor', function () {
return {
responseError: function (response) {
const error = response.data;
var error = response.data;
alert(error.error + "\r\n" + error.errors.map(function (e) {
return e.field + ": " + e.defaultMessage;
}).join("\r\n"));
return response;
}
}
});
});
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

angular.module('ownerDetails')
.controller('OwnerDetailsController', ['$http', '$stateParams', function ($http, $stateParams) {
const self = this;
var self = this;

$http.get('owners/' + $stateParams.ownerId).then(function (resp) {
self.owner = resp.data;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,9 @@

angular.module('ownerForm')
.controller('OwnerFormController', ["$http", '$state', '$stateParams', function ($http, $state, $stateParams) {
const self = this;
var self = this;

let ownerId = $stateParams.ownerId || 0;
var ownerId = $stateParams.ownerId || 0;

if (!ownerId) {
self.owner = {};
Expand All @@ -15,7 +15,7 @@ angular.module('ownerForm')
}

self.submitOwnerForm = function () {
const id = self.owner.id;
var id = self.owner.id;

if (id) {
$http.put('owners/' + id, self.owner).then(function () {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

angular.module('ownerList')
.controller('OwnerListController', ['$http', function ($http) {
const self = this;
var self = this;

$http.get('owners/list').then(function (resp) {
self.owners = resp.data;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,14 +2,14 @@

angular.module('petForm')
.controller('PetFormController', ['$http', '$state', '$stateParams', function ($http, $state, $stateParams) {
const self = this;
const ownerId = $stateParams.ownerId || 0;
var self = this;
var ownerId = $stateParams.ownerId || 0;

$http.get('petTypes').then(function (resp) {
self.types = resp.data;
}).then(function () {

const petId = $stateParams.petId || 0;
var petId = $stateParams.petId || 0;

if (petId) { // edit
$http.get("owners/" + ownerId + "/pets/" + petId).then(function (resp) {
Expand All @@ -29,16 +29,16 @@ angular.module('petForm')
});

self.submit = function () {
const id = self.pet.id || 0;
var id = self.pet.id || 0;

const data = {
var data = {
id: id,
name: self.pet.name,
birthDate: self.pet.birthDate,
typeId: self.petTypeId
};

let req;
var req;
if (id) {
req = $http.put("owners/" + ownerId + "/pets/" + id, data);
} else {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

angular.module('vetList')
.controller('VetListController', ['$http', function ($http) {
const self = this;
var self = this;

$http.get('vets').then(function (resp) {
self.vetList = resp.data;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,9 @@

angular.module('visits')
.controller('VisitsController', ['$http', '$state', '$stateParams', '$filter', function ($http, $state, $stateParams, $filter) {
const self = this;
const petId = $stateParams.petId || 0;
const url = "owners/" + ($stateParams.ownerId || 0) + "/pets/" + petId + "/visits";
var self = this;
var petId = $stateParams.petId || 0;
var url = "owners/" + ($stateParams.ownerId || 0) + "/pets/" + petId + "/visits";
self.date = new Date();
self.desc = "";

Expand All @@ -13,7 +13,7 @@ angular.module('visits')
});

self.submit = function () {
const data = {
var data = {
date: $filter('date')(self.date, "yyyy-MM-dd"),
description: self.desc
};
Expand Down

0 comments on commit 4280859

Please sign in to comment.