Currently, I am developing an android application using a combination of NativeScript, AngularJS2, and TypeScript. To guide my development process, I have been following the documentation provided by NativeScript, which can be found at this link.
However, I have encountered an issue while trying to implement a redirect functionality after a successful user login that should direct them to a page called List
. In order to resolve this, I followed the instructions outlined in the Routing section, available at this URL.
Despite diligently following the documentation, I am facing challenges with the implementation. Below are snippets of the relevant code:
app.component.ts
[Code snippet for app component]
user.service.ts
[Code snippet for user service]
login.component.ts
[Code snippet for login component]
Although most aspects of the application are functioning correctly, I am encountering an error when attempting to execute this._router.navigate(["List"])
from the file login.component.ts
. The specific error message received is:
JS: EXCEPTION: Error: Uncaught (in promise): TypeError: Cannot read property '_router' of null
At present, I am struggling to comprehend the root cause of this error.
Warm regards,