How to submit a JSON object to Database using *ngModel in ionic/angular

Clash Royale CLAN TAG#URR8PPPHow to submit a JSON object to Database using *ngModel in ionic/angular
I have a problem when I using ionic to submit a form with an Object. I am using mongodb as a database and ionic for mobile app.
Let me describe my problem.
I have 2 pages. Page 1 and page 2. In page 1 I have location data object with JSON object like this:
> public location: any = {
>
> address: '',
>
> longtude: '',
>
> latude: '' };
I am using *ngModel to store "location" variable and show the string of address on placeholder.
<ion-input placeholder="Your location" (click)="navigateToPage2()"
(ngModel)]="location" type="text"></ion-input>
When I click on textfield input (ion-input) it's will navigate to page 2 with a map page, in page 2 I will select my location (longtude, latude, address) and after finish the selection I will pass location object back to page 1 and show the real address on the placeholder. I only want to show address string in placeholder but will submit location object (address, longtude, latude) to database. How can I do? Becasue If I do as above code, in the placeholder will show like this: [object Object] not string address as I want. Please suggest me to that thing. Thanks you so much
By clicking "Post Your Answer", you acknowledge that you have read our updated terms of service, privacy policy and cookie policy, and that your continued use of the website is subject to these policies.