title: ionic 4 ng-true-value equivalence
body: <p>I'm rewriting an ionic 1 app to ionic 4.5.0, and i have a calculator like this in ionic 1:</p>
  
  <p>HTML:</p>
  
  <pre><code>    &lt;ion-toggle toggle-class="toggle-positive" id="myid" ng-model="data.product1" ng-false-value="0" ng-true-value="50"&gt;{{data.product1}}
        &lt;i class="icon ion-social-euro"&gt;&lt;/i&gt;
      &lt;/ion-toggle&gt;
  </code></pre>
  
  <p>ControllerJs:</p>
  
  <pre><code>$scope.data = {
      'product1' : 0,
      'product2' : 0,
      'product3' : 0
  }
  </code></pre>
  
  <p>On ionic 1 we had directives like:</p>
  
  <blockquote>
    <p>ng-false-value="0" ng-true-value="50"</p>
  </blockquote>
  
  <p>so, when toggle were on, the true value were 50, and false 0.</p>
  
  <p>On my new app, i'm trying to do the same:</p>
  
  <p>HTML:</p>
  
  <pre><code>   &lt;ion-item&gt;
        &lt;ion-label&gt;Product 1 {{data.product1}}&lt;/ion-label&gt;
        &lt;ion-toggle name="product1" [(ngModel)]="data.product1"&gt;&lt;/ion-toggle&gt;
      &lt;/ion-item&gt;
  </code></pre>
  
  <p>ts</p>
  
  <pre><code>data: any = { 
      product1: 0, 
      product2: 0,
      product3: 0
  };
  </code></pre>
  
  <blockquote>
    <p>{{data.product1}} is showing 0, but when i activate the toggle it's showing true or false</p>
  </blockquote>
  
  <p>I have found this solution, but it's for angular: <a href="https://juristr.com/blog/2018/02/ng-true-value-directive/" rel="nofollow noreferrer">https://juristr.com/blog/2018/02/ng-true-value-directive/</a></p>
  
  <p>Is there any equivalent or something else for ng-true-value and ng-false-value in ionic 4?</p>