title: How to change variable from another page Ionic4
body: <p>I'm creating a simple tabs-based app in Ionic4, and I want to change a variable in the main tabs page, where tabs switcher is shown, from the first tab, and I want to change this variable, when the scrolling position is on the right level on the first tab ionic content. The question is, how to change variable in tabs.page.ts from tab1.page.ts. I have info about the current day in html of tabs page, and it should change according to scroll position.</p>
  
  <p>tabs.page.ts file
  (I want to change current_day, because it's in my html file)</p>
  
  <pre class="lang-js prettyprint-override"><code>
  import { Component ,OnInit} from '@angular/core';
  import {formatDate} from '@angular/common';
  import { Storage } from '@ionic/storage';
  import { DatabaseService }  from '../database.service'
  import {NavController} from "@ionic/angular"
  @Component({
    selector: 'app-tabs',
    templateUrl: 'tabs.page.html',
    styleUrls: ['tabs.page.scss']
  })
  export class TabsPage {
    constructor() {
    }
    last_text:String = "";
    cur_text:String = "";
    som = 0
    beginning = 1564617600 * 1000 
    date:any = new Date()
    current_day:String = String(Math.floor((new Date(this.date.getTime() - this.beginning).getTime()+3 * 60*60*1000) / 1000 / 60 / 60 / 24)+1)
    lasts = new Date(this.date.getTime() - this.beginning)
    timerow:String = this.lasts.getHours()+":"+this.lasts.getMinutes()
    sleep(ms) {
    return new Promise(resolve =&gt; setTimeout(resolve, ms));
    }
    tonorm(str:String){
      let dobav;
      if (str.length == 1){
          dobav = "0"
      }
      else{
          dobav = ""
      }
      return dobav+str
    }
    iter(){
      this.date = new Date()
      this.current_day = String(Math.floor((new Date(this.date.getTime() - this.beginning).getTime()+3 * 60*60*1000) / 1000 / 60 / 60 / 24)+1)
      this.lasts = new Date(this.date.getTime() - this.beginning)
      this.timerow = this.tonorm(String(23-this.lasts.getHours()))+":"+this.tonorm(String(60 - this.lasts.getMinutes()))
    }
    updater(){
      this.iter()
      this.sleep(1000);
  
      }
    }
  </code></pre>
  
  <p>in tab1.page.ts code</p>
  
  <pre class="lang-js prettyprint-override"><code>onPageScroll(event) {
          this.scrlpos = event.detail.scrollTop
          if (this.scrlpos &gt;= 500){
              //change that variable
          }
      }
  </code></pre>
  
  <p>tabs.page.html</p>
  
  <pre class="lang-html prettyprint-override"><code>&lt;ion-tabs&gt;
    &lt;ion-list-header no-border slot="top"&gt;
      &lt;ion-label position="stacked" class="my-label"&gt;День {{current_day}}&lt;/ion-label&gt;
      &lt;ion-label position="stacked" class="my-label"&gt;{{timerow}}&lt;/ion-label&gt;
    &lt;/ion-list-header&gt;
    &lt;ion-tab-bar slot="bottom"&gt;
      &lt;ion-tab-button tab="tab1"&gt;
        &lt;ion-icon name="book"&gt;&lt;/ion-icon&gt;
        &lt;ion-label&gt;текст&lt;/ion-label&gt;
      &lt;/ion-tab-button&gt;
  
      &lt;ion-tab-button tab="tab2"&gt;
        &lt;ion-icon name="star"&gt;&lt;/ion-icon&gt;
        &lt;ion-label&gt;избранное&lt;/ion-label&gt;
      &lt;/ion-tab-button&gt;
  
      &lt;ion-tab-button tab="tab3"&gt;
        &lt;ion-icon name="settings"&gt;&lt;/ion-icon&gt;
        &lt;ion-label&gt;настройки&lt;/ion-label&gt;
      &lt;/ion-tab-button&gt;
    &lt;/ion-tab-bar&gt;
    {{updater()}}
  &lt;/ion-tabs&gt;
  
  </code></pre>