Where communities thrive

  • Join over 1.5M+ people
  • Join over 100K+ communities
  • Free without limits
  • Create your own community
Repo info
  • Mar 04 2021 17:42
    mrafaeli added as member
  • Dec 14 2020 03:27
    krohrsb closed #80
  • Jul 16 2020 00:36
    jpulec unassigned #365
  • Apr 30 2020 21:39
    jpulec closed #390
  • Apr 15 2020 14:38
    dacasas removed as member
  • Feb 07 2020 12:33
    dacasas added as member
  • Aug 21 2019 17:17
    llekn removed as member
  • Aug 21 2019 17:15
    llekn added as member
  • Jul 10 2019 14:38
    ftvannievelt removed as member
  • Jul 10 2019 14:38
    ftvannievelt added as member
  • May 26 2019 15:02
    saswatds closed #383
  • Nov 14 2018 22:13
    spidergears commented #382
  • Aug 22 2018 07:08
    eborned commented #407
  • Aug 22 2018 07:06
    eborned commented #407
  • Aug 02 2018 16:11
    blackjid closed #392
  • Aug 02 2018 16:11
    blackjid commented #392
  • Jun 02 2017 20:47
    blackjid reopened #384
  • Jun 02 2017 20:45
    ttonyh commented #384
  • Jun 02 2017 20:26
    jpulec removed as member
  • Jun 02 2017 20:25
    jpulec commented #384
Jonas Jonsson
well, I can tell you this much saving, where the request is rejected will not result in the record being modified.
The only thing that happens when the request fails are 'after-update-error' and 'after-save-error' events.
Hi @fatbrain thanks for you answer, I just added a description for the issue... don't paste it here because is a bit extensive
you can see it here #368
and thanks for the info about the events, didn't know that :)
North McCormick
Howdy! I am looking at different angular model modules, I am really liking this one, but I am kind of stressing about testability with jasmine/karma. I don't seem to see any solid resources on how one should mock the calls using $then, or any built in support. It could just be that I missed it in the Readme, it is early haha. Can anyone point me in the right direction or have any helpful resources for that
Dirk Groenen
I have no experience with testing icw restmod, but if you need to mock requests why not use Angular's standard $httpBackend?
Steven Hargrove
is there any full project example that uses angular-restmod that someone can refer me to?
Dawid Karabin
@hulkish In my job, we use restmod in our project
Steven Hargrove
do you recommend a good starting point?
Dawid Karabin
but it's not publicly available on github so I cannot post here a link to github etc. ;)
hmmm docs?
Steven Hargrove
well.. I’m building an app that actually will scale to be much larger
and I’m really having trouble deciding whether to go with $http, ngResource, restangular ….restmod etc lol
Dawid Karabin
hmm in our project we have 6 standalone servers, each has from 5 to 20 endpoints
we have a lot, a lot of restmod models
Steven Hargrove
do u use an api spec mechanism for defining ur rest api’s? like RAML?
Dawid Karabin
We decided 1 year ago to pick restmod because we had implemented HATEOAS in our REST api
nope, almost all apps based on Symfony 2+, now backend team is trying to migrate projects to Symfony 3
So in our project we use this to creating documentation for API
I am wrong please correct me, but RAML is sth like apiary?
documentation for api
Steven Hargrove
something like that, yes
basically, it acts as your original authored source for defining your API
Dawid Karabin
We've had a lot of troubles with apiary
because crazy long JSON
like 500loc and more were hard to maintain in apiary
Steven Hargrove
i understand the angular-restmod docs …im just having trouble understanding how it all comes together
Dawid Karabin
We have relations between endpoints represented as "_links" or "_embedded" properties in API
Steven Hargrove
would love to see some kind of boilerplate
Dawid Karabin
One thing, to be honest, in our project we don't use restmod's relations system
because relations are represented by "_links" and "_embedded"
so we decided to build custom abstraction on top of restmod
it's very, very similiar to HAL (http://stateless.co/hal_specification.html)
in terms of how our JSON responses look like
one more thing, in my other project I used angular-data, now it's called js-data (http://www.js-data.io/)
hey, can someone point me to instructions on how to create a custom action/method/route outside of the standard REST routes, with restmod?
much appreciated...i got to the "custom methods" part in the docs but didn't get anything from it besides that maybe i should be using super (?) to do it ?
Jared Morse
Is there a way to have an item removed from a collection immediately when calling $destroy()? Even better: have it added back on error? Trying to find a way to make my UI more responsive.
Yeah, Array.splice >.<
Jared Morse
Found a good way to do this in case others are interested: https://gist.github.com/jarcoal/7bd754fb909545c39f02f80ced826a50
Doesn't re-add on failure, but that should be easy to do with the promise returned from $destroy()
Punita Ojha
This message was deleted

Hello, I wonder if anyone can help me with a problem I am facing.

I have the following model set up (these are each in an angular factory function):

    emails: { hasMany: 'AccountEmailsModel' },

with emails being a child relation:


I am able to use the following to GET my collection:


for reference, the URL it GETS is /api/accounts/{accountId}/emails

this gives me data like so, which I assigned to a variable called myData:

  { first: { active: true } },
  { second: { active: true } },

I then change first.active to false and call $save(['active']) on that object. I expected this to send a PATCH request, but it sent a POST request.

I am also wondering if, when I call $save(['active']) if I can append first to the end of the URL so that it PATCH's on /api/accounts/{accountId}/emails/first

I am using version 1.1.9
Punita Ojha
This message was deleted