angular.module('myApp', []).controller('namesCtrl', function($scope) {
$scope.names = [
{name:'Jani',country:'Norway'},
{name:'Hege',country:'Sweden'},
{name:'Kai',country:'Denmark'}
];
});
function abc(){
$.ajax({url: "demo_test.txt", success: function(result){
$scope.names = result; // here
}});
}
I want to change the content of scope.names by result(it will be in json format) and then render the contents through angular.
And i want to clarify that i am bound to use get request from inside a function, so cant use $http of angular