title: Expected 2 arguments, but got 1.ts(2554) core.d.ts(8064, 47): An argument for 'opts' was not provided
body: <p>Error</p>
  
  <p>Expected 2 arguments, but got 1.ts(2554)
  core.d.ts(8064, 47): An argument for 'opts' was not provided.</p>
  
  <p>Code is from NativeScript Marketplace </p>
  
  <p><a href="https://play.nativescript.org/?template=play-ng&amp;id=Hqp5UQ&amp;v=3073" rel="noreferrer">https://play.nativescript.org/?template=play-ng&amp;id=Hqp5UQ&amp;v=3073</a> </p>
  
  <p>I've brought the code over verbatim and I"m getting the errors in my export class on</p>
  
  <pre><code>@ViewChild("password") password: ElementRef;
  @ViewChild("confirmPassword") confirmPassword: ElementRef;
  </code></pre>
  
  <p>Does anyone know how to resolve this?</p>
  
  <pre><code>import { Component, ElementRef, ViewChild } from "@angular/core";
  import { alert, prompt } from "tns-core-modules/ui/dialogs";
  import { Page } from "tns-core-modules/ui/page";
  import { RouterExtensions } from "nativescript-angular/router";
  
  import { User } from "../shared/user.model";
  import { UserService } from "../shared/user.service";
  
  @Component({
      selector: "app-login",
      moduleId: module.id,
      templateUrl: "./login.component.html",
      styleUrls: ["./login.component.css"]
  })
  export class LoginComponent {
      isLoggingIn = true;
      user: User;
      processing = false;
      @ViewChild("password") password: ElementRef;
      @ViewChild("confirmPassword") confirmPassword: ElementRef;
  
      constructor(private page: Page, private userService: UserService, private routerExtensions: RouterExtensions) {
          this.page.actionBarHidden = true;
          this.user = new User();
          this.user.email = "user@nativescript.org";
          this.user.password = "password";
      }
  
      toggleForm() {
          this.isLoggingIn = !this.isLoggingIn;
      }
  
      submit() {
          if (!this.user.email || !this.user.password) {
              this.alert("Please provide both an email address and password.");
  
              return;
          }
  
          this.processing = true;
          if (this.isLoggingIn) {
              this.login();
          } else {
              this.register();
          }
      }
  
      login() {
          this.userService.login(this.user)
              .then(() =&gt; {
                  this.processing = false;
                  this.routerExtensions.navigate(["/home"], { clearHistory: true });
              })
              .catch(() =&gt; {
                  this.processing = false;
                  this.alert("Unfortunately we could not find your account.");
              });
      }
  
      register() {
          if (this.user.password !== this.user.confirmPassword) {
              this.alert("Your passwords do not match.");
  
              return;
          }
          this.userService.register(this.user)
              .then(() =&gt; {
                  this.processing = false;
                  this.alert("Your account was successfully created.");
                  this.isLoggingIn = true;
              })
              .catch(() =&gt; {
                  this.processing = false;
                  this.alert("Unfortunately we were unable to create your account.");
              });
      }
  
      forgotPassword() {
          prompt({
              title: "Forgot Password",
              message: "Enter the email address you used to register for APP NAME to reset your password.",
              inputType: "email",
              defaultText: "",
              okButtonText: "Ok",
              cancelButtonText: "Cancel"
          }).then((data) =&gt; {
              if (data.result) {
                  this.userService.resetPassword(data.text.trim())
                      .then(() =&gt; {
                          this.alert(`Your password was successfully reset. Please check your email for
                          instructions on choosing a new password.`);
                      }).catch(() =&gt; {
                          this.alert("Unfortunately, an error occurred resetting your password.");
                      });
              }
          });
      }
  
      focusPassword() {
          this.password.nativeElement.focus();
      }
      focusConfirmPassword() {
          if (!this.isLoggingIn) {
              this.confirmPassword.nativeElement.focus();
          }
      }
  
      alert(message: string) {
          return alert({
              title: "APP NAME",
              okButtonText: "OK",
              message: ("{message}")
          });
      }
  }
  </code></pre>
  
  <p>The expected output is when the emulator loads it should detect a logged out user and show them the login page.</p>