Using ngModel values across pages

HI guys, I’m making an app and looking to use a range slider to set a value.
I’ve got that part fine, but I’m looking for this value to maybe be a global value that can be used in pages later pushed onto the stack. For context there are 6 pages with a user input on each and at the need to perform a calculation with all 6 values, and so I need a way to call values from different pages.

  <ion-range min="0" max="100" [(ngModel)]="Mobility" color = "secondary" pin="true">
    <ion-label range-left>0</ion-label>
    <ion-label range-right>100</ion-label>
<p class="mobility" > Mobility : {{Mobility}}</p>

As you can see above, the value are stored using ngModel, I can’t find any documentation (or havent looked well enough to find any) which explains how to use ngModel values across pages. Any ideas?

you need to put the data into a ‘provider’ really…

else the data is in context of the page that is being presented

I’d like to use the range api to get the value. can this still be done?

ngModel points to a variable in the class (ts) of the page… how this variable is set is up to you

I have no variable in my ts page that is representative of the ngModel value.

import { Component } from '@angular/core';
import { NavController, NavParams } from 'ionic-angular';
import { Q2Page } from '../Q2/Q2';

  selector: 'page-Q1',
  templateUrl: 'Q1.html'
export class Q1Page {
  icons: string[];
  items: Array<{title: string, icon: string}>;

  constructor(public navCtrl: NavController, public navParams: NavParams) {
    this.icons = ['checkmark' ];

    this.items = [];
    for(let i = 0; i <1 ; i++) {
        title: 'Next Question',
        icon: this.icons[Math.floor(Math.random() * this.icons.length)]

  itemTapped(event, item) {
    this.navCtrl.push(Q2Page, {
      item: item

my code isn’t as efficient as it could be but i cant determine where the ngModel value is. any ideas?


the [()] means bidrectional… but I haven’t ever experienced where it would CREATE the variable…

I’d add it

var Mobility: any;

to your class and set it to a value and see what happens