How to select one of multiple API's using radio buttons

So have to choose 1 of 2 urls (json strings) and select them using radio buttons.

url 1:

url 2:

I’m looking for information on this but can’t find any anywhere.

I’m presuming there is a way to do it with an array but haven’t found anything anywhere.


Take a look a tutorial about working with forms in Angular and you should able to solve your problem.

Hi Chris, thanks for your reply. I’ve watched a few tutorials on forms in Angular but none have been of any help for this issue.


<ion-content padding>

        <ion-radio slot="start" value="{{dataSource[0]}}" checked (ionSelect)="handleChoice('0')" ></ion-radio>
        <ion-radio slot="start" value="{{dataSource[1]}}" (ionSelect)="handleChoice('1')" ></ion-radio>


The TypeScript:

export class HomePage {
  private dataSource: Array<String> = ['', ''];
  constructor() { }

  handleChoice(val) {

I would take a better look at reactive forms in Angular as they will be very useful in actual development.


Hi Chris,

Thank you some much for that.