tutorials

Step 1: Set Up the Initial App

We start by setting up a simple app for this tutorial. The app displays mock data only and mimics real OData back-end calls with the mock server as you have seen in the Walkthrough tutorial.

The structure and data model created in this step will be used throughout the rest of this tutorial. The initial app created in this step will be extended in the subsequent steps to illustrate the navigation and routing features of OpenUI5.

Preview

Initial app with a simple button

Initial app with a simple button

Setup

The initial code for this step ships with the repository at packages/navigation/steps/01/. Open it and run:

npm install
npm start

This starts the local web server and opens a browser window hosting index.html.

If you prefer to work outside the monorepo, download the standalone bundle at Navigation and Routing - Step 1 (TS)Navigation and Routing - Step 1 (JS), extract it, and run the same two commands from the extracted folder.

You should have the same files as displayed in the following figure:

Folder structure with downloaded files

webapp/
├── Component.ts/.js
├── controller/
│   └── App.controller.ts/.js
├── i18n/
│   └── i18n.properties
├── index-cdn.html
├── index.html
├── initMockServer.ts/.js
├── localService/
│   ├── metadata.xml
│   ├── mockdata/
│   │   ├── Employees.json
│   │   └── Resumes.json
│   └── mockserver.ts/.js
├── manifest.json
└── view/
    └── App.view.xml

📝 The content of the localService folder will not be changed in this tutorial. The i18n folder will always contain the i18n.properties file only. Therefore, we will show both subfolders collapsed in the following steps.

The Initial App

With the downloaded coding, you have an initial app with recommended settings that provides the basic features of an OpenUI5 app:

So far we have a basic app that does not really have any navigation or routing implemented. This will change in the next steps when we implement our first navigation features.


Next: Step 2: Enable Routing