Hkh:How to develop and test local
From mn/ifi/inf5750
How to develop and test local
If your are developing/testing on localhost. Your should get data from file.
- Get data from local file
- Add a json file in to folder /data/. E.g: /data/me.json
- Inject your controller with urlInfo
- Create a variable - var url = ;
- Then create a if statement - if(urlInfo == "localhost)
- Set url to : 'data/me.json'
- Get data from dhis
- Inject your controller with urlInfo
- set url = urlInfo + '/api/me.json'
Then do $http.get(url); .....