Angular 2 p:autocomplete 自动更新

Angular 2 p:autocomplete auto update

我有两个输入元素,如下所示 ie.. (Search & P:autocomplete) ,我需要知道如何在搜索输入框中输入内容时填充 p-autoComplete 输入字段

<div style="vertical-align: middle">
    <span style="margin-left:118px;width:169px;font-style: normal; font-family: Verdana; color: #949494; font-size: 11px; font-weight: bold; text-decoration: none;">Search Job:  </span>
    <input type="text" id="searchVal" name="searchVal" style="width:448px;height:21px" #search="ngModel" [(ngModel)]="searchVal" (keyup)="searchonKeyEvent($event)" (mouseup)="searchMouseEvent($event)" />
    <input type="button" id="searchPABtn1" [ngClass]="{'disable-Button':!enableSearchButton,'submit-button':enableSearchButton}" 
[disabled]="!enableSearchButton"  (click)="searchJobNames(searchVal)" value="Search" style="margin-bottom:10px;width: 100px;margin-left:6px">
    </div>                  
</div>

<div style="vertical-align: middle">
  <span style="float: left;width:700px;margin-left: 106px">
    <span style="width:169px;font-style: normal; font-family: Verdana; color: #949494; font-size: 11px; font-weight: bold; text-decoration: none;">Job Name:<em class="required">*&emsp;</em></span>
    <div style="display:inline">
    <p-autoComplete name="projectCode" [(ngModel)]="projectCode" [suggestions]="filteredJobs" (completeMethod)="filteredJob($event)" [size]="30"
        [minLength]="1" placeholder="" [dropdown]="true" (onSelect)="onSelectUpdateValue()" (mouseup)="clearMouseEvent($event)" (onDropdownClick)="handleDropdownClick($event)" #update="ngModel">
    <template let-job>
        <div class="ui-helper-clearfix" style="">
            <div style="font-size:13px;float:left;">{{job}}</div>
        </div>
    </template>
    </p-autoComplete>
   </div>

不确定你到底想完成什么,但我想这就是你要找的:

<input type="text" [(ngModel)]="searchVal" (ngModelChange)="projectCode = $event"