1(function () { 2 'use strict'; 3 4 angular 5 .module('app') 6 .service('addressValidationService', addressValidationService); 7 8 addressValidationService.$inject = ['$http']; 9 10 function addressValidationService($http) { 11 12 var service = this; 13 14 service.validateAddress = function (addressToValidate) { 15 $(document).progressStart(); 16 return $http.post(apiRoot + 'api/AddressValidation/ValidateAddress', addressToValidate).then( 17 function (response) { 18 $(document).progressFinish(); 19 20 var validationResult = response.data; 21 addressToValidate.IsValid = validationResult.IsValidated; 22 return validationResult; 23 }, 24 function (error) { 25 $(document).progressFinish(); 26 idstc().processError({ error: error, showNotifications: true }); 27 throw error; 28 } 29 ); 30 }; 31 32 /** 33 Updates an address with the new address' information. 34 */ 35 service.updateAddress = function (addressToUpdate, newAddress) { 36 addressToUpdate.City = newAddress.City; 37 addressToUpdate.CountryID = newAddress.CountryID; 38 addressToUpdate.CountryName = newAddress.CountryName; 39 addressToUpdate.CountryTwoLetterISO = newAddress.CountryTwoLetterISO; 40 addressToUpdate.ProvinceID = newAddress.ProvinceID; 41 addressToUpdate.PostalCode = newAddress.PostalCode; 42 addressToUpdate.ProvinceAbbreviation = newAddress.ProvinceAbbreviation; 43 addressToUpdate.ProvinceName = newAddress.ProvinceName; 44 addressToUpdate.Street1 = newAddress.Street1; 45 addressToUpdate.Street2 = newAddress.Street2; 46 addressToUpdate.Street3 = newAddress.Street3; 47 addressToUpdate.Street4 = newAddress.Street4; 48 addressToUpdate.Region = newAddress.Region; 49 addressToUpdate.IsValid = newAddress.IsValid; 50 addressToUpdate.AddressID = newAddress.AddressID; 51 }; 52 } 53})();
Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.