Reputation: 1247
How can you call an ajax compatible WCF service inside a angular.js controller ?
I tried to combine Jquery and Angular.JS, something like :
app.controller('ListUsersController', function () {
var me = this;
this.listusers = [];
this.fill = function () {
$.getJSON("Contact.svc/getjemploye", function (data) {
me.listusers.push({id:"1",name:"Vinc"});
});
};
});
When I push the user inside the listusers, it look like the controller can't see I am adding something to the list, so it doesn't show the list again (In the html, I can't see the new user I just pushed).
Upvotes: 0
Views: 808
Reputation: 560
Angular has its own set of Ajax callers.
$http({ method: "GET", url: "http://yoururlhere.com")
.success(function (response) {
alert("success!");
});
Upvotes: 1