What is the different type of route models in Ember.js?

Category: Web Design HTMLWhat is the different type of route models in Ember.js?
Editor">Editor Staff asked 2 years ago

What is the different type of route models in Ember.js?

1 Answers
Editor">Editor Staff answered 2 years ago
    • Dynamic Models – It provides the routes with dynamic segments. These segments are used to access the value from URL

 

  1. Ember.Route.extend ({  
  2.    model(parameter) {  
  3.       //code block  
  4.    }  
  5. });  
  6.   
  7. Router.map(function() {  
  8.    this.route(‘linkpage’, { path: ‘identifiers’ });  
  9. });  
    • Multiple Models – It is used to define multiple models through RSVP.hash. For example:

 

  1. Ember.Route.extend ({  
  2.    model() {  
  3.       return Ember.RSVP.hash({  
  4.          //code block  
  5.       })  
  6.    }  
  7. });