If you recall from Chapter 1, Get Into Shape with @NgModule, recording is a feature that should only be available to authenticated users. Therefore, we will want to prompt the user with a login dialog when they tap the Record button on each track. If they are already logged in, we will want to prompt them to confirm if they want to re-record the track for good usability.
We could handle this dialog directly in the Component by importing a NativeScript dialog service that provides a consistent API across both platforms. The ui/dialogs module from the NativeScript framework (https://docs.nativescript.org/ui/dialogs) is a very convenient service, allowing you to create native alerts, confirms, ...