Skip to content
This repository has been archived by the owner on Oct 1, 2022. It is now read-only.

Commit

Permalink
demo(typeahead): refine http demo layout (ng-bootstrap#3497)
Browse files Browse the repository at this point in the history
This wraps the form control into the container to properly render inline
form controls and also replaces span with help small text for activity
status hint.
  • Loading branch information
peterblazejewicz authored and maxokorokov committed Dec 2, 2019
1 parent 8db025c commit 0e05dec
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 8 deletions.
15 changes: 8 additions & 7 deletions demo/src/app/components/typeahead/demos/http/typeahead-http.html
Original file line number Diff line number Diff line change
Expand Up @@ -8,12 +8,13 @@
<li><code>catch</code> operator to display an error message in case of connectivity issue</li>
</ul>

<div class="form-group">
<label for="typeahead-http">Search for a wiki page:</label>
<input id="typeahead-http" type="text" class="form-control" [class.is-invalid]="searchFailed" [(ngModel)]="model" [ngbTypeahead]="search" placeholder="Wikipedia search" />
<span *ngIf="searching">searching...</span>
<div class="invalid-feedback" *ngIf="searchFailed">Sorry, suggestions could not be loaded.</div>
</div>

<fieldset class="form-inline">
<div class="form-group">
<label for="typeahead-http">Search for a wiki page:</label>
<input id="typeahead-http" type="text" class="form-control mx-sm-3" [class.is-invalid]="searchFailed" [(ngModel)]="model" [ngbTypeahead]="search" placeholder="Wikipedia search" />
<small *ngIf="searching" class="form-text text-muted">searching...</small>
<div class="invalid-feedback" *ngIf="searchFailed">Sorry, suggestions could not be loaded.</div>
</div>
</fieldset>
<hr>
<pre>Model: {{ model | json }}</pre>
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ export class WikipediaService {
selector: 'ngbd-typeahead-http',
templateUrl: './typeahead-http.html',
providers: [WikipediaService],
styles: [`.form-control { width: 300px; display: inline; }`]
styles: [`.form-control { width: 300px; }`]
})
export class NgbdTypeaheadHttp {
model: any;
Expand Down

0 comments on commit 0e05dec

Please sign in to comment.