Introduction
ApexJS provides a structured environment for controllers, routes, views, state management, and application services.
Creating a controller
Controllers extend the core ApexJS controller and expose methods that can be connected to application routes.
const ApexJS = require('../../../lib/ApexJS');
class ExampleController extends ApexJS.Controller
{
async index ()
{
this.layout = "apexjs";
this.page = "example/index";
return {
title: "Example"
};
}
}
Registering the controller
ApexJS.StateManagement.AddController('example', ExampleController);