Last active
January 11, 2016 04:02
-
-
Save LarsBergqvist/abbb29da55f489a21be0 to your computer and use it in GitHub Desktop.
An AngularJS controller for fetching all channel info from the Swedish Radio open API
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var myApp = angular.module('myApp', []); | |
myApp.controller('SRChannelsController', ['$scope', '$http', function($scope, $http) { | |
var promise = $http.get("http://api.sr.se/api/v2/channels/?format=json&pagination=false&filter=channel.channeltype&filtervalue=Riks"); | |
promise.then(function(response) { | |
var channels = response.data.channels; | |
$scope.channels = channels; | |
}); | |
}]); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment