-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
46 changed files
with
717 additions
and
146 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
This file was deleted.
Oops, something went wrong.
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
44 changes: 44 additions & 0 deletions
44
docs/src/app/components/example-card/example-card.component.html
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,44 @@ | ||
<nz-ribbon nzText="GET"> | ||
<nz-card style="width: 600px" [nzTitle]="extraTitle"> | ||
<nz-card-tab> | ||
<nz-tabset nzSize="large" [nzTabBarExtraContent]="extraTemplate"> | ||
<nz-tab nzTitle="code"> | ||
<textarea rows="5" highlight-js [lang]="'javascript'"> | ||
fetch('{{ baseUrl }}{{ route }}') | ||
.then(json=>console.log(json)) | ||
</textarea> | ||
</nz-tab> | ||
<nz-tab nzTitle="output"> | ||
<textarea rows="10" class="output"> | ||
{{output}} | ||
</textarea> | ||
</nz-tab> | ||
</nz-tabset> | ||
</nz-card-tab> | ||
</nz-card> | ||
</nz-ribbon> | ||
|
||
<ng-template #extraTitle> | ||
<span style="font-size: large; font-weight: bold; font-family: 'Montserrat', sans-serif;">{{ title}}</span> | ||
</ng-template> | ||
|
||
<nz-modal [(nzVisible)]="isVisible" [nzTitle]="modalTitle" (nzOnCancel)="handleCancel()" (nzOnOk)="handleOk()"> | ||
<ng-container *nzModalContent> | ||
<nz-spin [nzSpinning]="showSpinner"></nz-spin> | ||
<nz-alert | ||
*ngIf="!showSpinner" | ||
[nzType]="'error'" | ||
[nzMessage]="'Failed to load sample code'" | ||
[nzDescription]="'Error 500: Server failed to handle your request'" | ||
></nz-alert> | ||
</ng-container> | ||
</nz-modal> | ||
|
||
<ng-template #extraTemplate> | ||
<button nz-button (click)="showModal()"> sample code</button> | ||
</ng-template> | ||
|
||
<ng-template #modalTitle> | ||
<span>Sample code ({{title }})</span> | ||
</ng-template> | ||
|
9 changes: 9 additions & 0 deletions
9
docs/src/app/components/example-card/example-card.component.scss
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,9 @@ | ||
.output { | ||
background: #000; | ||
color: #ccc; | ||
display: block; | ||
padding: 5px; | ||
width: 100%; | ||
height: auto; | ||
overflow-y: hidden; | ||
} |
21 changes: 21 additions & 0 deletions
21
docs/src/app/components/example-card/example-card.component.spec.ts
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,21 @@ | ||
import { ComponentFixture, TestBed } from '@angular/core/testing'; | ||
|
||
import { ExampleCardComponent } from './example-card.component'; | ||
|
||
describe('ExampleCardComponent', () => { | ||
let component: ExampleCardComponent; | ||
let fixture: ComponentFixture<ExampleCardComponent>; | ||
|
||
beforeEach(() => { | ||
TestBed.configureTestingModule({ | ||
declarations: [ExampleCardComponent] | ||
}); | ||
fixture = TestBed.createComponent(ExampleCardComponent); | ||
component = fixture.componentInstance; | ||
fixture.detectChanges(); | ||
}); | ||
|
||
it('should create', () => { | ||
expect(component).toBeTruthy(); | ||
}); | ||
}); |
38 changes: 38 additions & 0 deletions
38
docs/src/app/components/example-card/example-card.component.ts
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,38 @@ | ||
import { Component ,Input} from '@angular/core'; | ||
import { setOptions } from 'marked'; | ||
|
||
@Component({ | ||
selector: 'app-example-card', | ||
templateUrl: './example-card.component.html', | ||
styleUrls: ['./example-card.component.scss'] | ||
}) | ||
export class ExampleCardComponent { | ||
|
||
@Input() route: String; | ||
@Input() is_get: boolean; | ||
@Input() output: any; | ||
@Input() title: string; | ||
|
||
baseUrl = "http://127.0.0.1:8000/api"; | ||
|
||
isVisible = false; | ||
showSpinner =false; | ||
|
||
constructor() {} | ||
|
||
showModal(): void { | ||
this.isVisible = true; | ||
clearTimeout( setTimeout(() =>{ | ||
this.showSpinner =true; | ||
},5000)); | ||
this.showSpinner = false; | ||
} | ||
|
||
handleOk(): void { | ||
this.isVisible = false; | ||
} | ||
|
||
handleCancel(): void { | ||
this.isVisible = false; | ||
} | ||
} |
1 change: 1 addition & 0 deletions
1
docs/src/app/components/get-all-carts/get-all-carts.component.html
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 @@ | ||
<app-example-card [is_get]="true" [title]="title" [route]="route" [output]="output"></app-example-card> |
Empty file.
Oops, something went wrong.