kanjiroushi.controller('KanjiOfDayController', function ($scope,$rootScope,$http,config,$routeParams,$q) { //config $scope.apiUrl = config.apiUrl; //view objects $scope.kanjisOfDay = {}; //Retrieving product console.log('retrieving kanjis of day'); $scope.getKanjis= function() { $http({ url:config.apiUrl+'/kanji/oftheday', method:"GET", }). success(function(data, status, headers, config) { $scope.kanjisOfDay = data.msg.kanjis; }). error(function(data, status, headers, config) { console.log('error retrieving kanjis of the day'); }); } $scope.getKanjis(); })