Hkh:How to develop and test local

From mn/ifi/inf5750
Revision as of 15:04, 7 November 2013 by Kennetvu@uio.no (talk | contribs) (How to develop and test local)

Jump to: navigation, search

How to develop and test local

If your are developing/testing on localhost. Your should get data from file.

  1. Get data local
    1. Add a json file in to folder /data/. E.g: /data/me.json
    2. Inject your controller with urlInfo
    3. Create a variable - var url = ;
    4. Then create a if statement - if(urlInfo == "localhost)
    5. Set url to : 'data/me.json'
  2. Get data from dhis
    1. Inject your controller with urlInfo
    2. set url = urlInfo + '/api/me.json'

Then do $http.get(url); .....