Where communities thrive


  • Join over 1.5M+ people
  • Join over 100K+ communities
  • Free without limits
  • Create your own community
People
Repo info
Activity
    Matt Erman
    @CodeLiftSleep
    Is there any reason why on a Delete or Update Restangular would be adding in extra URL parts?
    For instance I have several forms, on most of them Update and Delete work for me when I restangularizeElement and pass in "Contract/Update?id=" for the route but on one of them it ends up "Contract/Contract/Update?id=" so I just pass in "Update?id=" and it works fine, but on one of the Delete's its now attempting to go to ...."API/API/Contract/Delete?id=" instead of "API/Contract/Delete?id="...the part that is weird is I am not passing in the extra API from anywhere, and the only other place a URL is set is in the main setBaseUrl when angular loads...where is this extra API coming from??
    Fredrik Boström
    @bostrom
    @CodeLiftSleep can you show some real code to debug?
    Matt Erman
    @CodeLiftSleep
    @bostrom I endde up getting it sorted out...it was a dumb mistake on my part
    Fredrik Boström
    @bostrom

    @CodeLiftSleep it would be much easier to help you if we could see some real code of what you're actually doing.

    Restangular works well with API calls like GET /books, PUT /books/15, DELETE /authors/50/books/5 and so on. If you have some more exotic backend API, then you most probably have to either do custom requests in Restangular (customGET, customPOST etc), or use vanilla $http service in angular.

    Please put up a code example on jsfiddle or codepen or github etc so we can understand what you're trying to accomplish.

    Matt Erman
    @CodeLiftSleep
    is the associated call being made in APICalls
    Fredrik Boström
    @bostrom
    Where's Restangular in this?
    Matt Erman
    @CodeLiftSleep
    once the page redirects after you successfully finish the update, the route then becomes "Module/Module/Update?id=" if you try and update anything else
    Lol...ack! just realized I'm not using it for this, OMG I feel like an idiot
    hahahaha
    Ok, back to the issue at hand...do you know of a way to resolve that?
    Fredrik Boström
    @bostrom

    @CodeLiftSleep I don't think this is the proper forum for random JS questions, you should probably try StackOverflow or similar instead.

    However, I created a pen of your code and it runs ok, so your problem must be elsewhere. http://codepen.io/anon/pen/jVNyJX?editors=0011#0

    Matt Erman
    @CodeLiftSleep
    I think I fixed it..."../Module/Update?id=" seems to work right
    but its weird because the same thing doesn't work with delete, nor does delete have the same issue
    although it isn't redirecting you so I guess maybe that is why
    Fredrik Boström
    @bostrom
    You probably shouldn't be using window.location.href directly either. Try using ng-router or ui-router.
    Matt Erman
    @CodeLiftSleep
    we aren't using Angular routes currently, we are kind of retrofitting Angular with ASP.net/MVC
    That is probably going to switch over but it hasn't happened yet
    Matt Erman
    @CodeLiftSleep
    Ok, now this is a restangular question...how would I access A relative path as a get? Like in Razor I could do $http.get('@Url.Content("~/Utility/GetAllProviders")' to call a relative path to a function that will retrieve data
    archas
    @archasek
    hello guys!
    would be great if anybody can take a look at mgonto/restangular#1435
    thanks :)
    Matt Erman
    @CodeLiftSleep
    How do you utilize @Url.Content to call a service function in restangular to get data?
    Colton Colcleasure
    @colshacol
    I have been working for hours to resolve this darn getList SHOULD be an array... error, and I just can not beat it. Can anybody offer assistance?
    Fredrik Boström
    @bostrom
    @colshacol still having problems? That message usually appears when a "list" endpoint doesn't return an array as topmost object. I.e. your list is wrapped in another object. Or perhaps you have a responseInterceptor that alters the data in some way before passing it to Restangular.
    Colton Colcleasure
    @colshacol
    @bostrom I spent 3 hours trying to solve it and finally c/p 4 lines of code that solved it. -_- Angular is not my forte, but work insisted.
    Matt Erman
    @CodeLiftSleep
    Anyone here? I'm trrying to use a restangular setErrorInterceptor but its not giving me anything in the content section I am sending over in the HTTPResponseMessage
    return new HttpResponseMessage(System.Net.HttpStatusCode.NotModified) { Content = new StringContent(ex.InnerException.ToString()) };
     RestangularProvider.setErrorInterceptor(function (response, deferred, responseHandler) {
                            alertify.error("Error! " + response.statusText + " : " + response.status);
                            return true;
    In this case it should be returning the content saying "Cannot insert duplicate row in database...blah blah blah" but that appears nowhere in any of the Restangular content...data comes back as ""
    the response doesn't contain the content from the HTTPResponse...where do I get that from?
    Matt Erman
    @CodeLiftSleep
    When an uncaught exception comes back ALL that info is available in the response...when I catch it, none of it is, WTF is the point in that??
    harishav
    @harishav
    Hi all, can I send request body in delete method?? Thanks in advance
    Manar Kurmanov
    @manar-mk
    Hi guys. Can I ask questions about ngx-restangular here?
    Colton Colcleasure
    @colshacol

    I just wanna boast a wee bit.

    I was just creeping around the Babel repo and saw it go v7.0.0-beta-0 as it happened. =3 I've been waiting for this!

    Andrew Boehner
    @Boehner
    .
    nacim issam
    @issamnacim
    hello all why RestAngular do not accepte empty response ?
    anyone can help me ?