json - Angularjs: getting http variable in function -
I am new to angular and want to get some data from a webservice I wrote. I am sending some variables with it as a post. But how can I get the http variable in the function? This may be a stupid question, but I do not have to solve. I want it in the function because I want to call it several times.
kljControllers.controller ('Calendar page controller', ['$ scope', function ($ radius, $ http) {$ Scope.GetEvents = function () {var datapost = array (); Datatostost. ($ Scope.month); datatostost .shoot ($ scope.year); $ scope.http.post ('http: // localhost: error (function (data, position, header, config) {document.write ($ 8080 / webservice / calendarevent '). Success (job, data, status, header, config) {$ scope.events = data.events;}). "Status");})}}}}
You can simply $ Http - it's $ scope < / Code> http.post ('http: // localhost: 8080 / Webservice / calendarevent ') is not required to submit the error (function (data, position, header, config) {document.write ("status");}) (successfully (function (data, position, header, config) ) {$ Scope.events = data.events;}).; You are also missing it in your controller declaration:
kljControllers .controller ('Calendar Page Controller', ['$ scope', "$ http", ^^^^^
Comments
Post a Comment