Skip to content

Commit

Permalink
languagesDirective: Adapt the /list/bears API change
Browse files Browse the repository at this point in the history
  • Loading branch information
meetmangukiya committed Jun 26, 2017
1 parent 57dfaf2 commit 92e45bc
Showing 1 changed file with 7 additions and 7 deletions.
14 changes: 7 additions & 7 deletions resources/js/Directives/languagesDirective.js
Original file line number Diff line number Diff line change
Expand Up @@ -20,15 +20,15 @@ app.directive('languages', ['$http', '$timeout' ,function ($http, $timeout) {
$scope.lang_loader=true;
$http.get(api_link + '/list/bears')
.then(function(data){
arr = []
angular.forEach(Object.keys(data["data"]), function(value, key){
arr = [];
angular.forEach(data["data"], function(bear){
arr.push({
"name" : value,
"desc" : data["data"][value]["desc"],
"languages": data["data"][value]["languages"]
})
"name" : bear["name"],
"desc" : bear["desc"],
"languages": bear["languages"]
});
})
$scope.bearList = arr
$scope.bearList = arr;
$scope.$evalAsync();
$scope.lang_loader = false;
$scope.$storage.bear_data = arr
Expand Down

0 comments on commit 92e45bc

Please sign in to comment.