I am currently working on developing an app using Ionic but experiencing some difficulties. I encountered an issue while trying to access a variable from a global service when it is imported to another page. Here is an example of the Global service (backend)
:
import { Injectable } from '@angular/core';
/*
Generated class for the BackendProvider provider.
*/
@Injectable()
export class BackendProvider {
}
export class globalUrl{
public globalUrl: "http://192.168.0.6:81/EBSWebApi/";
}
In my user service, I imported it in this manner:
import {globalUrl} from "../backend/backend";
And when attempting to access the **globalUrl** variable, I did the following:
export class UserProvider {
private url = globalUrl + "/api/getUsers";
}
Seeking advice on how to execute this correctly. Any guidance would be appreciated.