Ionic View is not Updating with Two way Data Binding

780 Views Asked by At

I am creating very basic ionic app. I want to show splash, then admob interstitial and on close of interstitial, i want to redirect to home page.

The only problem which I am facing here is updating the view in the home page. In home page, i have very simple text box and button. I am using 2 way data binding here and its not working at all.

I have created repo for this if somebody wants to have a look and let me know why the view is not updating.

https://github.com/krishnaa99/admobissue

Demo Video

https://www.youtube.com/watch?v=t_BKJ1mGpag
2

There are 2 best solutions below

1
Praveen penumaka On

Possible solutions you can try

  • you should check the logs for errors
  • Assign clear type to "input" variable. ( try making it explicitly public )
  • "input" may be considered as a keyword, try using a different variable name ( less likely )
1
saif khan On

if the value is changing in component but not in view(html) then after action in component use this.

import { ChangeDetectorRef } from '@angular/core';
constructor(private changeRef: ChangeDetectorRef){}
this.changeRef.detectChanges();

i hope it can help.