Angular 2 p:自动完成自动更新

时间:2016-11-15 13:05:09

标签: angular primeng

我有两个输入元素,如下面的..(搜索& P:自动完成),当我在搜索输入框中输入内容时,我需要知道如何填充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>

1 个答案:

答案 0 :(得分:1)

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

RewriteEngine on
RewriteCond %{REQUEST_FILENAME} !-f
RewriteRule . / [L,R=301]

ErrorDocument 404 /index.php