Skip to content

Commit

Permalink
Merge pull request #29 from moxie-lean/rest-api
Browse files Browse the repository at this point in the history
New metadata support
  • Loading branch information
Rulox committed May 31, 2016
2 parents 5bd2952 + 8458e05 commit 0c26c1b
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 2 deletions.
4 changes: 2 additions & 2 deletions lib/cms.client.service.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,9 @@ angular
.module('lnCms')
.factory('lnCmsClientService', lnCmsService);

lnCmsService.$inject = ['$http', 'lnCmsConfig', '$log'];
lnCmsService.$inject = ['$http', 'lnCmsConfig'];

function lnCmsService($http, lnCmsConfig, $log) {
function lnCmsService($http, lnCmsConfig) {

return {
getRoutes: getRoutes,
Expand Down
6 changes: 6 additions & 0 deletions lib/cms.controller.js
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,12 @@ function lnCmsController($rootScope, $scope, lnCmsClientService, $urlRouter, $st
.getData(endpoint, params)
.then(function(response) {
vm.view = response.data;

if ( angular.isArray( vm.view ) && angular.isDefined( vm.view[0].meta ) ) {
vm.meta = vm.view[0].meta;
} else if ( angular.isDefined( vm.view.meta ) ) {
vm.meta = vm.view.meta;
}
});
}
}
Expand Down

0 comments on commit 0c26c1b

Please sign in to comment.