Ivan Kukic
Ivan Kukic

Reputation: 425

Fill HTML select with options from Web.config

I have an HTML page, with a <select> which has a few options in it. Currently, these options are hardcoded into the HTML.

Is there a way to get a list of options in Web.config, get them in my AngularJS controller, and populate the <select>?

Upvotes: 1

Views: 282

Answers (1)

Skrface
Skrface

Reputation: 1422

You can do what you want following those steps :

  1. Load your options from the Web.config file : how
  2. Create a ViewModel to represents your select options
  3. Create a new endpoint to GET this ViewModel : how
  4. Populate your options in your AngularJS application : how

All of that is basic and it's easy to find more information to achieve what you need.

Hope it helps.

Upvotes: 3

Related Questions