I am working on a project where I have a list of users, and each user can have zero, one, or many files. This creates a one-to-many relationship between the users table and the files table.
In my backend code, I store the list of users along with their files as part of the user entity. Now, in the front end, I need to display the user details along with any attachments (files) they may have.
Here is a snippet of my code:
user: {username?: string, password?: string, files: {docfile?: string}} = {};
constructor(public navParams: NavParams) {
this.user = navParams.data;
}
And here is the corresponding HTML:
<ion-content padding>
<ion-label>username : </ion-label>
{{user.username}}
</p>
<p>
<ion-label>Documents : </ion-label>
<img src={{user.documents.docfile}} />
</p>
</ion-content>
Can anyone provide guidance on how to proceed with this setup?