I have created a service and I have a responce, but I don't know how to use
that responce into a controller.
The service that I have:
angular
.module('MyApp')
.service('telForm', function($http){
this.getAll = function(success, failure){
$http.get('https://service.com.mx/telehone')
.success(success)
.error(failure);
}
})
// the answer is
{
"telehone": "12121212",
"token": "760619"
}
The controller that I want to contruct: (moreless)
var1 = "telephone";
var2 = "token";
$http({
method:'POST',
url:"http://www.example-server.com/" + telephone + "/" + token +
"/example",
data : {
phone: $scope.phone,
company: $scope.company,
contract: '1',
privacy: '1',
email: $scope.email
},
headers: {
'Content-Type': 'application/json'
}
})
Thanks in advance
--
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.