Controller.js file code:
var myApp=angular.module('myApp',[]);
myApp.controller('myController', function($scope,$http){
$http.get('data.json').success(function(data){
$scope.art=data;
});
});
Controller.js file code:
var myApp=angular.module('myApp',[]);
myApp.controller('myController', function($scope,$http){
$http.get('data.json').success(function(data){
$scope.art=data;
});
});
You have to assign response to $scope.art
var myApp=angular.module('myApp',[]);
myApp.controller('myController', function($scope,$http){
$http.get('data.json').success(function(response){
$scope.art=response;
});
});
Note : The deprecated .success and .error methods have been removed from AngularJS 1.6
Using .then
var myApp=angular.module('myApp',[]);
myApp.controller('myController', function($scope,$http){
$http.get('data.json').then(function(response){
$scope.art=response.data;
});
});
var myApp=angular.module('myApp',[]);
myApp.controller('myController', function($scope,$http){
$http.get('data.json').then(function(response){
$scope.art=response.data;
});
});
Try with above. Might help!!