Ember.js MutableArray firstObject Property
The firstObject property is used to retrieve the first object of the array.
Return Value: The first object in the array.
To run the following examples, you will need to have an ember project with you. To create one, you will need to install ember-cli first. Write the below code in the terminal:
npm install ember-cli
Now you can create the project by typing in the following piece of code:
ember new <project-name> --lang en
To start the server, type:
Example 1: Type the following code to generate the route for this example:
ember generate route richest-people
Output: Visit localhost:4200/richest-people to view the output
Example 2: Type the following code to generate the route for this example:
ember generate route notepad
Output: Visit localhost:4200/notepad to view the output
Please Login to comment...