1(function() { 2 'use strict'; 3 angular.module('CepModule', []) 4 .provider('CepService', function() { 5 this.$get = function() { 6 7 return { 8 9 // Retorna um array com os dados dos estados 10 getEstados: function() { 11 return [ 12 { id: "1", nome: "Acre", sigla: "AC" }, 13 { id: "2", nome: "Alagoas", sigla: "AL" }, 14 { id: "3", nome: "Amapá", sigla: "AP" }, 15 { id: "4", nome: "Amazonas", sigla: "AM" }, 16 { id: "5", nome: "Bahia", sigla: "BA" }, 17 { id: "6", nome: "Ceará", sigla: "CE" }, 18 { id: "7", nome: "Distrito Federal", sigla: "DF" }, 19 { id: "8", nome: "EspÃrito Santo", sigla: "ES" }, 20 { id: "9", nome: "Goiás", sigla: "GO" }, 21 { id: "10", nome: "Maranhão", sigla: "MA" }, 22 { id: "11", nome: "Mato Grosso", sigla: "MT" }, 23 { id: "12", nome: "Mato Grosso do Sul", sigla: "MS" }, 24 { id: "13", nome: "Minas Gerais", sigla: "MG" }, 25 { id: "14", nome: "Pará", sigla: "PA" }, 26 { id: "15", nome: "ParaÃba", sigla: "PB" }, 27 { id: "16", nome: "Paraná", sigla: "PR" }, 28 { id: "17", nome: "Pernambuco", sigla: "PE" }, 29 { id: "18", nome: "PiauÃ", sigla: "PI" }, 30 { id: "19", nome: "Rio de Janeiro", sigla: "RJ" }, 31 { id: "20", nome: "Rio Grande do Norte", sigla: "RN" }, 32 { id: "21", nome: "Rio Grande do Sul", sigla: "RS" }, 33 { id: "22", nome: "Rondônia", sigla: "RO" }, 34 { id: "23", nome: "Roraima", sigla: "RR" }, 35 { id: "24", nome: "Santa Catarina", sigla: "SC" }, 36 { id: "25", nome: "São Paulo", sigla: "SP" }, 37 { id: "26", nome: "Sergipe", sigla: "SE" }, 38 { id: "27", nome: "Tocantins", sigla: "TO" } 39 ]; 40 }, 41 42 // Recebe um array de estados e a sigla UF, para retornar o id da UF escolhida 43 consultaIdEstado: function(listaEstadosBrasileiros, siglaUf) { 44 let idUf = ""; 45 for(let i = 0; i<listaEstadosBrasileiros.length; i++){ 46 if(listaEstadosBrasileiros[i].sigla.toUpperCase() == siglaUf.toUpperCase()){ 47 idUf = listaEstadosBrasileiros[i].id; 48 break; 49 } 50 } 51 return idUf; 52 }, 53 54 // Recebe um array de municÃpios e o nome do municÃpio escolhido, para retornar o id do escolhido 55 consultaIdMunicipio: function(listaMunicipios, nomeMunicipio) { 56 let idMunicipio = ""; 57 for(let i = 0; i<listaMunicipios.length; i++){ 58 if(listaMunicipios[i].nome.toUpperCase() == nomeMunicipio.toUpperCase()){ 59 idMunicipio = listaMunicipios[i].id.toString(); 60 } 61 } 62 return idMunicipio; 63 }, 64 65 66 }; 67 } 68 }); 69 })();
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.