title: Angular 2/Ionic 2 ngModel Dynamic Global Variable
body: <p>Hi everyone I currently am attempting to use my ngModeled variable globally. </p>
  
  <p>So far I have the following code snippet.</p>
  
  <p>homepage.html</p>
  
  <pre><code>&lt;ion-input type="text" value="" [(ngModel)]="databaseID"&gt; 
  </code></pre>
  
  <p>homepage.ts</p>
  
  <pre><code>public databaseID;
  </code></pre>
  
  <p>These functions work and when I attempt to print the ngModeled data from the home.ts class it prints what has been entered by the user. However I am not sure how to call databaseID from another class.  I have tried setting databaseID to global (globals are static and therefor this will not work).</p>
  
  <p>Could you possibly explain a way that I may access this variable from a different class?</p>
  
  <p>Some possible thoughts I had were dependency injection and using a providers. But I'm not sure what would be the best way to do so.</p>