Join the social network of Tech Nerds, increase skill rank, get work, manage projects...
 
  • How to Get the API Calling in AngularJS Application?

    • 0
    • 0
    • 0
    • 0
    • 0
    • 0
    • 0
    • 456
    Answer it

    Assume that there are 3 APIs. Each API does exactly the same task(to give you weather details) but has different endpoints as follows:

    • API 1: Can only be used for India. Has methods named requestWeather(), requestWeatherDataForWeek()
    • API 2: Can only be used for the USA. Has methods named sendRequest(), weatherDataForWeek()
    • API 3: Can only be used for the UK. Has methods named getWeather(), getWeatherDataForWeek().

     

    Select the country using the drop-down.

    a. Select the API according to the country. API selection is programmatic, which will be decided according to the country selected by the user.

    b. Write your code such that, any API can be used without disturbing the business logic.

    c. There must be a limit on the number of requests that can be sent. Throw an error if no. of requests exceed the limit.

    d. It does not require HTTP calls or APIs. Just create a wrapper for API with the specified method and return some dummy values.

 0 Answer(s)

Sign In
                           OR                           
                           OR                           
Register

Sign up using

                           OR                           
Forgot Password
Fill out the form below and instructions to reset your password will be emailed to you:
Reset Password
Fill out the form below and reset your password: