AngularJS ng-options syntax


I keep forgetting the correct syntax for ng-options in angular dropdowns. The documentation can be found here: https://docs.angularjs.org/api/ng/directive/ngOptions

The syntax used in the documentation is a bit confusing:

select as label for value in array

A concrete example for the syntax would look like this:

item.Id as item.Name for item in itemSource

I hope this helps myself and maybe someone else as well…

, ,

Leave a Reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.