Skip to content

Instantly share code, notes, and snippets.

@ronaiza-cardoso
Created April 12, 2017 18:06
Show Gist options
  • Save ronaiza-cardoso/4d71b8406a4dadb610030fadf88e59c6 to your computer and use it in GitHub Desktop.
Save ronaiza-cardoso/4d71b8406a4dadb610030fadf88e59c6 to your computer and use it in GitHub Desktop.
Service to import global vars
import { Injectable } from '@angular/core';
// Declare LoadingService as a provider in app.module.ts
// Inject LoadingService in your class: constructor(private globalUrls: GlobalUrls){}
// Use the this.globalUrls.SERVER_URL to instantiate your variable
@Injectable()
export class GlobalUrls {
SERVER_URL: string = ''
constructor() {
this.SERVER_URL = 'http://186.216.192.246:8081/homolog/sgtweb/transapp.php';
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment