class AppActivity

extends AppComponent

Activity base class. Represents a component of an application, which can be activated and deactivated independently. Can be used for activities that are activated independently of the UI; otherwise refer to any of the ViewActivity classes.


export class MyActivity extends AppActivity {
  path = "/";

  async onManagedStateActiveAsync() {
    await super.onManagedStateActiveAsync();
    console.log("MyActivity is now active");
    // not associated with a view


(name?: string, path?: string): AppActivity



Optional human readable name for this activity.



Optional activation path; if set to a string, this activity is automatically activated and deactivated asynchronously, depending on the current target path (e.g. URL path, handled by a platform dependent AppActivationContext instance).



The path segments that were captured last based on the target path, as matched by the AppActivationContext, for a path such as foo/bar/:id, foo/*name, or ./:id. This property is set when the activity is activated through activateAsync.


(): AppActivity

Returns the activity instance that contains a managed child reference that (indirectly) points to this activity instance.


(): Application

Returns the parent application that contains this activity, if any.


(match?: MatchedPath): Promise<void>

Activate this activity, based on given captured path segments (returned by AppActivationContext.match, for a path such as foo/bar/:id, foo/*name, or ./:id). This method is called automatically when the activity path matches the current target path, and can be overridden to validate the captured path segments before activation.


(): Promise<void>

Deactivate this activity.


(): Promise<void>

Destroy this activity.


(): boolean

Returns true if this activity is currently active.



The time (result of when this activity was last deactivated; or undefined if this activity has never been deactivated.



Inherited from AppComponent.renderContext.



Inherited from AppComponent.activationContext.


Activity presets type, for use with Component.with.



Human readable name for this activity.



(Partial) activation path, see AppActivity.path.