Where communities thrive


  • Join over 1.5M+ people
  • Join over 100K+ communities
  • Free without limits
  • Create your own community
People
Repo info
Activity
  • Jul 16 00:36
    jpulec unassigned #365
  • Apr 30 21:39
    jpulec closed #390
  • Apr 15 14:38
    dacasas removed as member
  • Feb 07 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
  • Jun 02 2017 04:34
    ttonyh commented #384
  • May 18 2017 14:27
    winsandymyint closed #408
Jonas Jonsson
@fatbrain
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.
vprogramador
@vprogramador
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
@NorthMcCormick
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
@dirkgroenen
I have no experience with testing icw restmod, but if you need to mock requests why not use Angular's standard $httpBackend?
Steven Hargrove
@hulkish
is there any full project example that uses angular-restmod that someone can refer me to?
Dawid Karabin
@hinok
@hulkish In my job, we use restmod in our project
Steven Hargrove
@hulkish
do you recommend a good starting point?
Dawid Karabin
@hinok
but it's not publicly available on github so I cannot post here a link to github etc. ;)
hmmm docs?
Steven Hargrove
@hulkish
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
@hinok
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
@hulkish
do u use an api spec mechanism for defining ur rest api’s? like RAML?
Dawid Karabin
@hinok
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
@hulkish
something like that, yes
basically, it acts as your original authored source for defining your API
Dawid Karabin
@hinok
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
@hulkish
i understand the angular-restmod docs …im just having trouble understanding how it all comes together
Dawid Karabin
@hinok
We have relations between endpoints represented as "_links" or "_embedded" properties in API
Steven Hargrove
@hulkish
would love to see some kind of boilerplate
Dawid Karabin
@hinok
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/)
djvs
@djvs
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
@jarcoal
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.
djvs
@djvs
Yeah, Array.splice >.<
Jared Morse
@jarcoal
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
@punitaojha
This message was deleted
Anth
@anthw

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):

restmod
  .model('/accounts')
  .mix({
    emails: { hasMany: 'AccountEmailsModel' },
  })

with emails being a child relation:

restmod.model()

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

AccountModel
  .$new(accountId)
  .emails
  .$resolve()
  .$asPromise()

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
@punitaojha
This message was deleted