What is the difference between .all() and .one() in Restangular?

The one() function has a second argument that accepts an id e.g. .one('users', 1).

  • one('users', 1).get() translates to /users/1
  • all('users').getList() translates to /users

Unlike all(), one() is not generally used with .getList() without argument. However, if you were to call .one('users', 1).getList('emails') or .one('users', 1).all('emails').getList(), then you would make a GET request to /users/1/emails.

Leave a Comment

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)