Documentation

AppActivationContext

class AppActivationContext

extends ManagedObject

Represents the application state using a single path in URL format. Used by Application and AppActivity classes to implement routing behaviors.

Note: An instance of this object is provided by the Application object (e.g. BrowserApplication), and is also available on all activities and views as activationContext.

Constructor

(): AppActivationContext

.target

string

The current full target path, in URL format without leading or trailing slashes (e.g. foo/bar/123), defaults to the empty string. Changes to this property automatically result in a change event being emitted on the object itself.

.navigate()

(_path: string): void

Navigate to given (relative) path, in URL format or :back to go back in history; to be overridden, the base implementation does nothing.

.match()

(path: string, activity?: AppActivity): MatchedPath

Check if given activity path matches the current target path.

  • path — The activity path to match, without leading slashes (e.g. foo/bar). Paths with a trailing slash (e.g. foo/bar/) match the exact path as well as sub paths. Paths may contain partial captures as either :foo or *foo, matching a single segment without slashes and the full remainder of the target path, respectively - but not an empty segment. The prefix ./ is replaced with the path (string) of the closest parent activity that has a AppActivity.path string property.

  • activity — The activity that is used to search for parent activities if necessary.

Returns: An object with properties for all partial captures if given path matches the current target, or undefined otherwise.

.managedId

number

Inherited from ManagedObject.managedId.

.managedState

ManagedState

Inherited from ManagedObject.managedState.

.getReferenceCount() protected

(): number

Inherited from ManagedObject.getReferenceCount.

.getManagedReferrers() protected

(): ManagedObject[]

Inherited from ManagedObject.getManagedReferrers.

.getManagedParent() protected

[1]. (): ManagedObject
[2]. <TParent extends ManagedObject>(ParentClass: ManagedObjectConstructor<TParent>): TParent

Inherited from ManagedObject.getManagedParent.

.emit()

<TEvent extends ManagedEvent = ManagedEvent, TConstructorArgs extends any[] = any[]>(e: string | TEvent | (new (...args: TConstructorArgs) => TEvent), ...constructorArgs: TConstructorArgs): this

Inherited from ManagedObject.emit.

.propagateChildEvents() protected

[1]. (f?: (this: this, e: ManagedEvent, propertyName: string) => void | ManagedEvent | ManagedEvent[]): this
[2]. (...types: (ManagedEvent | (new (...args: any[]) => ManagedEvent))[]): this

Inherited from ManagedObject.propagateChildEvents.

.activateManagedAsync() protected

(): Promise<any>

Inherited from ManagedObject.activateManagedAsync.

.deactivateManagedAsync() protected

(): Promise<void>

Inherited from ManagedObject.deactivateManagedAsync.

.destroyManagedAsync() protected

(): Promise<void>

Inherited from ManagedObject.destroyManagedAsync.

.onManagedStateActivatingAsync() protected

(): Promise<void>

Inherited from ManagedObject.onManagedStateActivatingAsync.

.onManagedStateActiveAsync() protected

(): Promise<void>

Inherited from ManagedObject.onManagedStateActiveAsync.

.onManagedStateDeactivatingAsync() protected

(): Promise<void>

Inherited from ManagedObject.onManagedStateDeactivatingAsync.

.onManagedStateInactiveAsync() protected

(): Promise<void>

Inherited from ManagedObject.onManagedStateInactiveAsync.

.onManagedStateDestroyingAsync() protected

(): Promise<void>

Inherited from ManagedObject.onManagedStateDestroyingAsync.


AppActivationContext.MatchedPath

Captured path segments, matched by AppActivationContext.match.

.path

string

The full path that was matched.

[…]

[captureId: string]: string;

Any captured path segments from the matching activity path.