The RapidAPI Developer Hub

Welcome to the RapidAPI developer hub. You'll find comprehensive guides and documentation to help you start working with RapidAPI as quickly as possible, as well as support if you get stuck. Let's jump right in!

Get Started    Guides
Ask A Question

Questions

Rapid SDK and Angular callbacks..

Posted by Marcus Saw 5 months ago

Hi,

I am trying to integrate the Rapid sample code with a simple Angular app. I am facing some problem with passing the response back from the controller:

angular.module('demo', [])
.controller('Hello', function($scope, $http) {
var rapid = new RapidAPI("default-application_59efcacce4b06b4ed0ef3560", "27c9768f-abcf-41b6-890b-56f1b5c0a378");

rapid.call('YahooWeatherAPI', 'getWeatherForecast', { 
    'location': 'tokyo'
}).on('success', function (payload) {
     /*YOUR CODE GOES HERE*/ 
    $scope.greeting = payload.query;
}).on('error', function (payload) {
     $scope.greeting = "NO GO";
});

});

Any help will be appreciated..

Loading comments...