Answer the question
In order to leave comments, you need to log in
How to pass string to form from JS to Angular?
You need to enter a string into the element from the browser and submit the form.
<form class="form-horizontal form-horizontal_search ng-valid ng-valid-required ng-dirty" role="form" name="efBpForm" ng-submit="action.search()" novalidate="">
<input ng-model="searchParameters.agreementNumber" placeholder="" class="form-control form-base__form-control ng-pristine ng-valid clearable" clearable="" name="">
let elementInput = angular.element('input[ng-model="searchParameters.agreementNumber"]');
elementInput.val('101');
elementInput.scope().$apply();
angular.element('form[ng-submit="action.search()"]').submit();
Answer the question
In order to leave comments, you need to log in
You have
you don't have to do
let elementInput = angular.element('input[ng-model="searchParameters.agreementNumber"]');
elementInput.val('101');
elementInput.scope().$apply();
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question