Centralize configuration for ionic 3 project


#1

Hello,

I need to have a file that contains all links api to have one file with all configuration that i can use on the project…
Any idea how to proceed ?


#2

I do like following:


#3

And the file Ressources is in which folder ?


#4

I put it in src/providers/resources.ts (or in a subfolder)

Import for example in a page in src/pages:

import {Resources} from  '../providers/resources';

#5


#6

My bad, sorry, it’s a json there was a typing mistake. I edited my solution.

Respectily modify like following:

 ....
   api_offres: 'http...',

#7

Perfecto :ok_hand:t2:
Thank you it’s working now