angular.module('myApp', []).controller('myController', function ($scope, 
$http) {
    $http.get('/api/contacts').success(function (data) {
        $scope.contactList = data;
    });

    $scope.addContact = function ()
    {
        $http.post('/api/addcontact', $scope.contact).then(function () { 
            console.log("good");
        }, function () { 
            console.log("error");
        });        
    }
});

The post function could work, sending the data to that api, but the 
callback is never triggered. Does anyone know why this happened.
Thank you.

-- 
You received this message because you are subscribed to the Google Groups 
"AngularJS" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To post to this group, send email to [email protected].
Visit this group at https://groups.google.com/group/angular.
For more options, visit https://groups.google.com/d/optout.

Reply via email to