Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- @Injectable()
- export class RestaurantesProvider {
- private url: string = "http://199.169.9.9/ws/ListarEstados.ashx";
- constructor(private http: Http) {
- console.log(this.url);
- }
- getRestaurantes(){
- return this.http.post(this.url, null)
- .do(this.logResponde)
- .map(this.extractData)
- .catch(this.catchError);
- }
- private catchError(error: Response | any){
- console.log(error);
- return Observable.throw(error.json().error || "Erro de conexção");
- }
- private logResponde(res: Response){
- console.log(res);
- }
- private extractData(res: Response){
- return res.json();
- }
- }
- private url: string = padrao + "ListarEstados.ashx";
- export class AppModule {
- private url: string = "http://199.169.0.9/ws/ListarEstados.ashx";
- getUrl(){
- return this.url;
- }
- }
- private url: string = AppModule.getUrl();
- export class AppModule {
- private static url: string = "http://199.169.0.9/ws/ListarEstados.ashx";
- static getUrl(){
- return this.url;
- }
- }
- private url: string = AppModule.getUrl();
- import { AppModule } from '../app/app.module';
Add Comment
Please, Sign In to add comment