Explain model with reference to ember.js. Also, tell how it is defined in it.
Answer Posted / Avaneendra Pathak
In Ember.js, a Model represents the data or business logic of an application. It defines the properties and behavior for an object that can be serialized and deserialized. To define a model, use Ember Data's built-in `DS.Model` class by extending it with your custom properties and methods.nnFor example:n```javascriptnimport DS from '@ember-data/data';nnexport default DS.Model.extend({n name: DS.attr('string'), // property definition for a string type attribute called 'name'n});```
| Is This Answer Correct ? | 0 Yes | 0 No |
Post New Answer View All Answers