daily pastebin goal
44%
SHARE
TWEET

Untitled

a guest Oct 22nd, 2018 85 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. componentDidMount() {
  2.     console.log("MOUNT");
  3.     $.ajax({
  4.         url:"http://localhost:10774/sbrp-service/rest/grafico/viagens_municipio",
  5.         dataType: 'json',
  6.         success:function(resposta) {
  7.             console.log(resposta);
  8.  
  9.             const novaListaMedia = [];
  10.             const novaListaMunicipio = [];
  11.  
  12.             for (let i = 0; i < resposta.length; i++) {
  13.                 novaListaMedia.push(resposta[i].media);
  14.                 novaListaMunicipio.push(resposta[i].municipio);
  15.             }
  16.  
  17.             this.setState({
  18.                 listaMedia: novaListaMedia,
  19.                 listaMunicipio: novaListaMunicipio
  20.             });
  21.         }
  22.     }.bind(this));
  23. };
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top