Javascript 要设置值并使其有效(ng有效、ng脏、ng触摸)

Javascript 要设置值并使其有效(ng有效、ng脏、ng触摸),javascript,jquery,angular,Javascript,Jquery,Angular,我对Angular非常陌生,我的表单有一个输入字段,我必须按键来验证它 我不想按任何键。我想设置输入字段的值并验证(更新状态)字段 <body> <app-root _nghost-c0="" ng-version="6.1.10"> <app-home _nghost-c1="" class="ng-star-inserted"><form _ngcontent-c11="" novalidate="" class="ng-invalid ng-unt

我对Angular非常陌生,我的表单有一个输入字段,我必须按键来验证它

我不想按任何键。我想设置输入字段的值并验证(更新状态)字段

<body>
<app-root _nghost-c0="" ng-version="6.1.10">
<app-home _nghost-c1="" class="ng-star-inserted"><form _ngcontent-c11="" novalidate="" class="ng-invalid ng-untouched ng-pristine"><p-autocomplete _ngcontent-c11="" aria-label="Enter To station. Input is Mandatory." delay="100" id="destination" class="ng-pristine ng-invalid ng-untouched">
<input autocomplete="off" class="ui-inputtext ui-widget ui-state-default ui-corner-all ui-autocomplete-input ng-star-inserted" type="text" placeholder="To*" ng-model="to">
<div class="ui-autocomplete-panel ui-widget-content ui-corner-all ui-shadow" style="display: none; width: 100%; max-height: 200px;"></div>
</p-autocomplete>
<button _ngcontent-c11="" class="search_btn" label="Find Results" type="submit">Find Results</button>
</form>
</app-home>
</app-root>
</body>

找到结果

您可以在上创建演示并与我们共享url吗。更新评论部分,这样我就不会知道它是模板还是反应。看起来像是运行时html,而不是开发模板代码。