Reputation: 21
I have the following drop-down button
<select class="input-block-level" ng-model="final_select"
ng-options="l.id as l.name group by l.group for l in final_selections['objects']">
</select>
final_selections['objects'][0] = {"id":"A","name":"A: assigned-already","group":"Assign"}
How can I print a string like "selected A" below the dropdown, once the object A selected? means ng-change triggered and the value A selected then show the message.
Upvotes: 0
Views: 1583
Reputation: 21
Thanks Narendra, that was a great answer. Update to your answer ng-change="onChangeSelected(finalSelected)"
to ng-change="onChangeSelected(finalSelected)"
Upvotes: 1
Reputation: 913
Maybe something like below:
$scope.onChangeSelected = function(item) {
$scope.finalSelected = item;
}
<select class="input-block-level" ng-model="final_select"
ng-options="l.id as l.name group by l.group for l in final_selections['objects']"
ng-change="onChangeSelected(finalSelected)">
</select>
<div>
Selected {{finalSelected.name}}
</div>
Upvotes: 1