Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import { Component } from '@angular/core';
- import {Http } from '@angular/http';
- @Component({
- selector: 'app-root',
- templateUrl: './app.component.html',
- styleUrls: ['./app.component.css']
- })
- export class AppComponent {
- title = 'app works!';
- //http://localhost:8080/WebServiceSPPD/sppd/getListaEstacao --> não funciona
- //https:// -->ep.com.br/ws/06332240/json/ --> funciona
- url: string = 'http://localhost:8080/WebServiceSPPD/sppd/getListaEstacao';
- constructor(http: Http){
- http.get(this.url)
- .map(res => res.json())
- .subscribe(estacoes => {
- console.log(estacoes)
- });
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment