0
API를 치고 결과를 생성하는이 검색 함수를 만들었습니다. 나는 지금 나의 결과를 클릭하여 배열로 푸시하려고하고있다. 특정 선택 물을 ngModel에 어떻게 연결합니까?각도 2를 사용하여 검색에서 객체를 배열로 푸시
<input type="text" class="form-control" placeholder="Angular" [(ngModel)]="company.technology[i].stack" name="technology_{{i}}" #technology="ngModel" required>
기능을 밀어 :
는onAddStack() {
this.company.technology.push({stack: ''});
}
나의 새로운 검색 기능 :
<input (keyup)="$event.target.value && searchTerm$.next($event.target.value)">
<ul *ngIf="results">
<a *ngFor="let result of results | slice:0:7" class="other" (click)="onAddStack()">
<li>{{ result.name }}</li>
</a>
</ul>