-
-
Notifications
You must be signed in to change notification settings - Fork 347
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add HTTP verb selection to the url box
- Loading branch information
Showing
7 changed files
with
61 additions
and
8 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
<div class="url-box row"> | ||
<clr-dropdown> | ||
<button type="button" class="url-box__button btn btn-outline-primary col-xs-1" clrDropdownTrigger> | ||
POST | ||
<clr-icon shape="angle down"></clr-icon> | ||
</button> | ||
<clr-dropdown-menu *clrIfOpen> | ||
<button type="button" clrDropdownItem>POST</button> | ||
<button type="button" clrDropdownItem>GET</button> | ||
<button type="button" clrDropdownItem>PUT</button> | ||
<button type="button" clrDropdownItem>DELETE</button> | ||
</clr-dropdown-menu> | ||
</clr-dropdown> | ||
<input #urlInput type="text" class="url-box__input col-xs-11" placeholder="Enter URL" (blur)="setApiUrl()" (keyup.enter)="setApiUrl()" | ||
[value]="apiUrl"> | ||
</div> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
import {Component, EventEmitter, Input, Output, ViewChild} from '@angular/core'; | ||
|
||
@Component({ | ||
selector: 'app-url-box', | ||
templateUrl: './url-box.component.html' | ||
}) | ||
export class UrlBoxComponent { | ||
@Input() apiUrl: string; | ||
@Output() updatedUrl = new EventEmitter(); | ||
|
||
|
||
@ViewChild('urlInput') urlInput; | ||
constructor() { } | ||
|
||
setApiUrl() { | ||
const url = this.urlInput.nativeElement.value; | ||
this.updatedUrl.emit(url); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters