import { Component } from "@angular/core";
import { HttpClient } from "@angular/common/http";
import { NavController } from "@ionic/angular";

@Component({
  selector: "app-home",
  templateUrl: "home.page.html",
  styleUrls: ["home.page.scss"]
})
export class HomePage {
  userName = "";
  password = "";
  constructor(private http: HttpClient, private navCtrl: NavController) {}
  clickedStar() {
    const url = `/asset/a/login?__ajax=true&username=${
      this.userName
    }&password=${this.password}&mobileLogin=true`;
    this.http.post(url, {}).subscribe(r => {
      console.log(r);
    });
  }

  nav() {
    this.navCtrl.navigateForward("/scan");
  }
}
