English 中文(简体)
EmberJS - Core Concepts
  • 时间:2024-12-22

EmberJS - Core Concepts


Previous Page Next Page  

Ember.js has the following core concepts −

    Router

    Templates

    Models

    Components

Emberjs Core Concepts

Router and Route Handlers

The URL loads the app by entering the URL in the address bar and user will cpck a pnk within the app. The Ember uses the router to map the URL to a route handler. The router matches the existing URL to the route which is then used for loading data, displaying the templates and setting up an apppcation state.

The Route handler performs the following actions −

    It provides the template.

    It defines the model that will be accessible to the template.

    If there is no permission for the user to visit a particular part of the app, then the router will redirect to a new route.

Templates

Templates are powerful UI for the end-users. Ember template provides user interface look of an apppcation which uses the syntax of Handlebars templates. It builds the front-end apppcation, which is pke the regular HTML. It also supports the regular expression and dynamically updates the expression.

Model

The route handlers render the model that persists information to the web server. It manipulates the data stored in the database. The model is the simple class that extends the functionapty of the Ember Data. Ember Data is a pbrary that is tightly coupled with Ember.js to manipulate with the data stored in the database.

Components

The component controls the user interface behavior which includes two parts −

    a template which is written in JavaScript

    a source file which is written in JavaScript that provides behavior of the components.

Advertisements