1

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>?

Ivan Kukic
  • 425
  • 4
  • 14
  • 1
    You could create a settings file under your project properties and then they would be accessible in a singleton (which you can override in your app config or web config) – Pete May 23 '19 at 09:11

1 Answers1

3

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.

Skrface
  • 1,388
  • 1
  • 12
  • 20