Quantcast
Channel: Ionic Framework - Ionic Forum
Viewing all articles
Browse latest Browse all 49258

Ionic 4 how to display updated data inside modal without refresh

$
0
0

@Pratikjaiswa15 wrote:

I am updating data into the database but can’t display updated data without refresh. The scenario is user changes the variable ‘quantity’ using select, then this quantity gets updated successfully in the database, Now I want to display price like
database, Now I want to display price like

p.price * p.quantity

without refreshing the page because this is happening inside a modal. Can anyone please help me in acheieving this. Thank you

html

<ion-row>
                        <option  [ngValue] = "q" *ngFor ="let q of quantity" >{{q}}</option>
                        </select>
                        &nbsp; {{p.product.unit}}      
                  </ion-row>
                    <br>
                    <ion-row class="ion-text-end"> 
                      {{ p.price * p.quantity | currency:'INR' }}

                    </ion-row>

Ts

onChange(new_quantity,object  ) {

    console.log("Quantity new " + new_quantity)
    console.log("price per kg "  + object.price)
    console.log("Quantity Old " + object.quantity)
    console.log("cart_id " + object.cart_id)


    let cart = {
      cart_id : object.cart_id,
      date : new Date,
      quantity : Number (new_quantity),
      price : object.price,
      user_id : object.user_id,
      product_id : object.product_id
    }

    console.log(cart)

Posts: 2

Participants: 2

Read full topic


Viewing all articles
Browse latest Browse all 49258

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>