Friday, June 27, 2014

Angular.js: Create a select list with a default option

Like most things in Angular.js, once you know how to do it, it’s really simple. This time I was struggling with creating a dropdown in Angular.js and providing it with an extra default ‘select a category…’ option.

This is how I got this working:

The only thing I had to do was adding one extra <option> tag myself inside the <select>.  Easy enough once you know it!

No comments: