Hi, I’m using router-lite
and I’d like to use the navigation model in my component in a plain-JS Au2 app. In the docs it says to do:
export class NavBar {
private readonly navModel: INavigationModel;
public constructor(@IRouteContext routeCtx: IRouteContext) {
this.navModel = routeCtx.navigationModel;
}
public async binding() {
await this.navModel.resolve()
}
}
I can’t figure out how to do the equivalent of @IRouteContext routeCtx: IRouteContext
in my constructor. I’ve tried @inject
ing IRouteContext
directly, using both newInstanceOf
and newInstanceForScope
, etc. but I get errors that (I think) indicate that it’s not registered for injection (e.g., AUR0012
).
What’s the proper way to use a navigation model from plain JS?