I am trying to display data from a JSON file onto the webpage. My Code
angular.module('bioA.configs',['ngRoute'])
//Config routes
.config(['$routeProvider',function($routeProvider){
$routeProvider.when('/',
{
templateUrl: 'list.tpl.html',
controller: 'BioACtrl',
resolve: {
bioAList: ['$http',function($http){
return $http.get('bioa.json');
}]
}
});
}]);
//Controller to Manage the data
angular.module('bioA.controllers',['bioA.configs'])
.controller('BioACtrl',['bioAList','$scope',function($scope,bioAList){
console.log(bioAList);
$scope.samples = bioAList.data.samples;
}]);
angular.module('bioA',['ngRoute','bioA.controllers','bioA.configs','ui.bootstrap']);
The $http doesnt seem to resolve.
here is the console output:
I am AngularJS noob any help is appreciated :) I am stuck. Why is the resolved object a ChildScope rather than being a promise ?
samplesbut notdata. Sounds likebioAListhas been created but there is nowdata