I have this in my html page:
<ion-content padding>
<ion-list></ion-list>
</ion-content>
I want to add items to this list from my .ts file. How do I do such a thing?
Rendering HTML on .ts is not a good option, you should add an Array/Observable on .ts and render it using ngFor
<ion-list>
<ion-item *ngFor="let term of yourArray;">
<p>{{term}}</p>
</ion-item>
</ion-list>
.ts Code will be,
yourArray = ['first','second'];
What do you mean by "adding ion-items to my .ts file"? You are supposed to add ion-items to your ion-list in the .html file.
Try the following:
<ion-content padding>
<ion-list>
<ion-item>
My first item in this list
</ion-item>
<ion-item>
My second item in this list
</ion-item>
</ion-list>
</ion-content>
Please refer to the documentation in order to view a full example of ion-items inside ion-lists.