Add select option by using <a> in AngularJS?


How can I add more select option in AngularJS example like this:

<div ng-app="MyApp" ng-controller="MyController">
    <label>Student Class:</label>
    <select id="class" name="class">
    <a href="#" id="add" style="color: blue;">Add class</a>


You can use either attributes/directives:

  • ng-options in your select element
  • ng-repeat in your option element

Here’s an example(suppose that you have an array of objects names ‘options’ in your $scope):

<select id="class" name="class" ng-options="option as for option in options track by option.value">

<select id="class" name="class">
  <option ng-repeat="option in options">
     <a href="option.address">{{}}</a>

Answered By – mindthefrequency

Answer Checked By – David Marino (AngularFixing Volunteer)

Leave a Reply

Your email address will not be published.