Js code does not work the before a one time click anywhere the page

ionViewWillEnter() {
signin() {
let input_user = (document.getElementById(‘input_user’) as HTMLInputElement).value;
let input_password = (document.getElementById(‘input_pass’) as HTMLInputElement).value;
this.credentials.email = input_user;
this.credentials.password = input_password;

this.authservice.login(this.credentials).then((res: any) => {
  if (....)


Try using this
ionViewWillEnter() {

:smiley: thank you :slight_smile:

Is this for normal operation or some sort of testing? You shouldn’t be directly dealing with the DOM like this under normal operation.

1 Like

Okey. for my private app. we can say a kind of test.

As long as you’re clear that this is a really unusual thing to be doing in Ionic apps. Angular provides a zillion more idiomatic ways of binding DOM elements to controller properties.