last day (14 days later) » 

12:19 PM
0
A: how to remove error while calling server request

Wayne ElleryIndexCtrl is undefined. To fix the error define IndexCtrl: var IndexCtrl = function ($scope, Restangular){ console.data(Restangular.all("data").getList().$object); }; angular .module('app') .controller('IndexCtrl', IndexCtrl); IndexCtrl.$inject = ['$scope', "Restangular"];

 
could you please send the share code
please check I used your code goo.gl/tbVgkY but not working
 
There's lots of other issues. I fixed the one you posted in the question. I'd suggest you read some tutorials before posting a question like this.
 
please help to remove error so that i will learn I try goo.gl/tbVgkY ..where Is issue .could you please help me removing error
 
What is RestangularProvider? It's not declared anywhere?
 
Actually I make example after study of this tutorial bahmutov.calepin.co/… he used RestangularProvider
did you use restangular.js file before ? Please look on this issue
did you find anything ..any problem
 
12:19 PM
You should use plunkr. It's much better
 
hi sir
 
Hi
Ok. Your test app thing is really slow
 
Change your code to this angular.module('app',["RestangularProvider"])
.config(function () {
RestangularProvider.setBaseUrl('http://184.106.159.143:8180/FGRailApps/jservices/rest/a/departure?crsCode=pad');
});
eh
I mean angular.module('app',["RestangularProvider"])
.config(function (RestangularProvider) {
RestangularProvider.setBaseUrl('http://184.106.159.143:8180/FGRailApps/jservices/rest/a/departure?crsCode=pad');
});
eh
that's wrong also
I'll work through it
it will take a few minutes
 
thanks
sir
please make a plunker sir
I am thankfull to you
 
12:31 PM
I haven't used Restangula
before
I'm getting this error: Error: [$injector:modulerr] Failed to instantiate module restangular due to:
ReferenceError: _ is not defined
oh. Looks like it required underscore
 
may be
 
So it's kind of working
looks like CORS is stopping it
 
but no output
:(
 
yeah, that's because your server doesn't allow the call
HttpRequest cannot load 184.106.159.143:8180/FGRailApps/jservices/rest/a/…. No 'Access-Control-Allow-Origin' header is present on the requested resource. Origin 'http://run.plnkr.co' is therefore not allowed access.
do you own 184.106.159.143?
You will need to add the Access-Control-Allow-Origin there to allow cross domain requests
 
ok wait
checking
 
12:37 PM
because we are requesting from a different domain
 
yes wait checking
 
For now you can just allow *
hello
json-server looks pretty cool
 
not working sir
I thing we did not some where else
 
were you able to add the header?
 
actually I disable security of browser and and checking
but getting error
I think we are doing wrong I don't know
where we are lagging
but most of the developer using restangular.js file
 
12:54 PM
it's almost working
it's requesting the json
 
ok
could you please give a url
 
console.data(Restangular.all("data").getList().$object); isn't working
 
ok
if you click the url it gives the json
 
i think it may need 'ngRoute'
do you know what this rectangular thing is
 
No sir
 
1:01 PM
oh. the json has no data
 
mean
 
it looks like your url is not restful
if you have a look at the examples it's very simple
 
it is resfull please check on click it give json
ok
so what be the solution may I remove restangular.js
from project
actually documentation is given here github.com/mgonto/restangular#element-methods
 
so your urls should be like /users to get all users
and then /users/1
your url is like departure?crsCode=pad
which is not restful
 
ok
may be what will the problem
 
1:07 PM
when you specify Restangular.all("data")
it will go to base url + /data
so for my case above the Restangular.all("users")
would request /users
 
so it mean I am not able to use rectangular using given url
?
 
Restangular is for restful services
you get use $http
 
$http in angular
?
 
1:09 PM
yeah
 
do you know any restfull service
 
I can give you a restful url that you could use
for your demo
 
ok sir
please provide one or two urls
 
You can't output the result
because it's asyncronous
 
1:14 PM
It's working now
did you see it?
 
yes sir
working thanks sir
 
It actually works with that url without changing browser settings
Can you please select my answer as the right one
 
yes sir
thanks
please also upvote my Question
 
It wasn't a good quesiton so I won't be upvoting it
Thanks for selecting my answer
Good luck with learning more Angular
 

last day (14 days later) »