- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎03-14-2023 04:30 AM
Im using ng-change to get the value which is selected but its throwing error
<div>
<select name="versions" ng-modal="versions" ng-change="c.passversion(versions)" class="custom-select">
<option selected>----Select Version----</option>
<option value="value1">V1</option>
<option value="value2">V2</option>
<option value="value3">V3</option>
</select>
</div>
c.passversion=function(versionss){
alert(versionss);
}
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎03-14-2023 05:05 AM
Hi @Prem13 ,
The issue with your code is that you have misspelled the attribute name in the select element. Instead of "ng-modal", it should be "ng-model". This is causing the value to not be properly bound to the variable "versions" in your controller.
Regards,
Shravan.
Please mark this as helpful and correct answer, if this helps you
Shravan
Please mark this as helpful and correct answer, if this helps you
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎03-14-2023 05:05 AM
Hi @Prem13 ,
The issue with your code is that you have misspelled the attribute name in the select element. Instead of "ng-modal", it should be "ng-model". This is causing the value to not be properly bound to the variable "versions" in your controller.
Regards,
Shravan.
Please mark this as helpful and correct answer, if this helps you
Shravan
Please mark this as helpful and correct answer, if this helps you