# Entry Points

## Entry Points

EJS uses the concept of **entry points** to facilitate selective execution paths throughout the application. This allows a user to jump into the application from an entry point specific to the task at hand, only loading the necessary [modules](https://docs.elentra.org/ejs/1.1/guide/modules) and files to complete it.

## How It Works <a href="#how-it-works" id="how-it-works"></a>

An entry point is specified simply by adding some attributes to the root DOM node. A **route name** may be specified to determine the initial execution path via the `data-route` attribute, with its parameters passed in using the `data-route-params` attribute. Additionally, an optional `data-layout`attribute may be used to specify a component to wrap the application.

## Examples <a href="#examples" id="examples"></a>

#### Example 1: Booting the application without a default execution path <a href="#example-1-booting-the-application-without-a-default-execution-path" id="example-1-booting-the-application-without-a-default-execution-path"></a>

```markup
<div id="#app-root"></div>
```

#### Example 2: Specifying the name of an initial route to execute with route parameters <a href="#example-2-specifying-the-name-of-an-initial-route-to-execute-with-route-parameters" id="example-2-specifying-the-name-of-an-initial-route-to-execute-with-route-parameters"></a>

```markup
<div id="#app-root" data-route="my.route" data-route-params="{ param1: 1, param2: 'foo' }"></div>
```

#### Example 3: Specifying a layout component to wrap the application <a href="#example-3-specifying-a-layout-component-to-wrap-the-application" id="example-3-specifying-a-layout-component-to-wrap-the-application"></a>

```markup
<div id="#app-root" data-layout="MyLayoutComponent"></div>
```
