I'm new to AngularJS, this is a part of my controller.js file, I made the login controller work with the same service, of this one.
What I want to achieve now is to get the data from an AJAX call using a different method from my service and pass it like this to my HTML.
What is the proper way of doing so? This is as far as I've tried, and I wrote this code based on my previous Chrome Packaged App project. The difference is that in my first project I have a single javascript file to change display in my HTML, this time, I'm manipulating it through controllers, services and app.
.controller('VFCtrl', function($scope, $stateParams, $http, $ionicLoading, $state, $sce) {
$ionicLoading.show({
template: 'Loading...',
duration: 1000
});
$http.post('myService/mysite.aspx',{action: 'someMethodFromService', ParameterFromMethod: 'someValue'})
.success(function (response)
{
var htmldata='';
for(i=0;i<response.length;i++)
{
var htmlInfo = '<li><div class=\'col\'><a href="'+ response[i].Id +'"><img width=\'100%\' height=\'auto\' src="'+response[i].Image + '" class=\'profile-img\' /><h3>' +response[i].Name+'</h3><p>'+response[i].Title+'</p></a></div></li>';
htmldata+= htmlInfo;
}
$("#vflist").html(htmldata);
})
//I don't wanna change how to submit data in my html in the success part
//But if it MUST be change then I will.
.error(function(data, status, headers){
console.log(status);
});
})
litags and the attributes on them. No need for jQuery at at all there.