LoginSignup
0
0

More than 5 years have passed since last update.

unit testでinputにセットした値をmodelValueに反映してvalidateしなおす

Posted at

inputに値をセットしただけではモデルに値が反映されません。$applyとかしても効きません。

angular.element($('div[inclusion="true"] input')).val('http://example.com/').trigger('input')

$scope.form.expression.$commitViewValue()
$scope.form.expression.$validate()

jQueryを使わない場合は angularjs - Setting view value an input field in a unit test of an angular form directive - Stack Overflow を参照。

0
0
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
0
0