I have a model named TodoModel
and a collection named Todos
. The url that I use to fetch data is an external api, hence I am overriding my collection's url function as
url:function(){
return "http://abc.com/data"
}
This works fine when I write Todos.fetch()
from my view.
Now, I want to pass some parameters like http://abc.com/data/[id]
.
On click of every element there will be a different api call with different ids. For example:
http://abc.com/data/123
http://abc.com/data/234
How do I achieve this?
Should I set the url of my model to this external url? How should I go about this problem?