|
The backbone.js urlRoot Model is used when we are using a Model outside the collection. The urlRoot will be used to make the url where the model reside on the server. We can use urlRoot as property and function in both ways. Syntax: model.urlRoot or model.urlRoot() Properties:
Example 1: In this example, we will illustrate the Backbone.js urlRoot model. Here we will use urlRoot as the address for the data and fetch the data for the model. HTML
Output: Following we can see the url of resource and the data we fetch form server: Backbone.js urlRoot model Example 2: In this example, we will use urlRoot as a function and append some attributes in url of the data. HTML
Output: Backbone.js urlRoot model Reference: https://backbonejs.org/#Model-urlRoot |
Reffered: https://www.geeksforgeeks.org
JavaScript |
Related |
---|
![]() |
![]() |
![]() |
|
![]() |
Type: | Geek |
Category: | Coding |
Sub Category: | Tutorial |
Uploaded by: | Admin |
Views: | 12 |