I need to find ',' from input string of text-area that i have and on based on result i need to restrict input string or give alert to user. i am new with angular and not sure how to achieve this functionality.
Here's my code that i tried:
<div class="text-area-container">
<textarea id="txt_1" class="txt_1-box" rows="2" data-ng-model="MyTextAreaValue"></textarea>
</div>
Angular Code:
$scope.myfun= function($event) {
var myStr = $scope.MyTextAreaValue;
// Here I am not sure after this what i have to do?
};
Please note I need to check that if there are max 3 comma it gives you alert or stop user to add other comma to string.
Thanks in Advance!!