Speech to Text tool content is not recognised in angularJS elements,

4 vues
Accéder directement au premier message non lu

Krithika Jagannathan

non lue,
13 déc. 2017, 10:54:0513/12/2017
à Angular and AngularJS discussion
Hi,

Speech to Text tool content is not recognised in angularJS elements, but vanilla Javascript and jquery ($('#id').val() is fetching the content. 

Element remains to be pristine. Added ng-mouseover="checkEntry('')" in the input box
                             
                             $scope.checkEntry = function(variable){
var ros=$('#'+variable).val();
       var len=$('#'+variable).val().length;
                              if(len>0){
var idVal=$('#'+variable).attr("id");
var ngVal=$('#'+variable).attr("ng-model");
var ngMaxLen=$('#'+variable).attr("maxlength");
var elementid = idVal;
var ngModelid = ngVal;
var nMaxLen = ngMaxLen;
if(len>nMaxLen){
$scope.form [''+variable]=="";
$scope.form [''+variable]=ros.substring(0,nMaxLen);
else{
$scope.form [''+variable]=ros;
}
$scope.form [''+variable].$dirty = true;
$('#'+variable).trigger('change');
}
};

Is viewValue and modelValue of the element is unaffected. Will custom directive solve this problem. 

My scenario is "When the user clicks the input box and speaks over microphone, the content is getting populated in
the angular input box" but it is not becoming dirty and hence it is not resizing the textarea and on submitting the form
validation message popups up saying the value is empty"

Please suggest a solution to solve this problem

Thanks,
Krithika 
Répondre à tous
Répondre à l'auteur
Transférer
0 nouveau message