0 votes
in Angular by

what is the code, if you want to bind the selected option in the tag h1?

1. ng-controller="myCtrl"> <p>Select a car:</p> <select> <option ng-repeat="x in cars">{{x.model}}</option> </select> </div>

2. <select ng-model=""> <option ng-repeat="x in cars">{{x.model}}</option> </select> <h1>You selected: {{}}</h1>

3. <select ng-model="selectedCar"> <option ng-repeat="x in cars">{{x.model}}</option> </select> <h1>You selected: {{selectedCar}}</h1> 

4. <select ng-model="selectedCar"> <option ng-repeat="x in cars">{{x.model}}</option> </select> <h1>You selected: {{selectCar}}</h1>

1 Answer

0 votes
by
Correct answer is :-  <select ng-model="selectedCar"> <option ng-repeat="x in cars">{{x.model}}</option> </select> <h1>You selected: {{selectedCar}}</h1>
...