-
Notifications
You must be signed in to change notification settings - Fork 1.5k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(docs): add capability to use playground module in the docs appli…
…cation (#310)
- Loading branch information
1 parent
aa46f65
commit 7676095
Showing
13 changed files
with
155 additions
and
34 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 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 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,15 @@ | ||
import { Component, Input } from '@angular/core'; | ||
|
||
@Component({ | ||
selector: 'nb-dynamic-to-add', | ||
template: ` | ||
<div> | ||
<strong>hello from dynamically inserted component: {{text}}</strong> | ||
</div> | ||
`, | ||
}) | ||
export class NbDynamicToAddComponent { | ||
|
||
@Input() | ||
text: string = ''; | ||
} |
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 @@ | ||
export * from './popover-example.component'; |
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,28 @@ | ||
/** | ||
* @license | ||
* Copyright Akveo. All Rights Reserved. | ||
* Licensed under the MIT License. See License.txt in the project root for license information. | ||
*/ | ||
|
||
import { NgModule } from '@angular/core'; | ||
import { RouterModule, Routes } from '@angular/router'; | ||
import { NbPopoverExampleComponent } from './examples'; | ||
import { NbPlaygroundComponent } from './playground.component'; | ||
|
||
|
||
export const routes: Routes = [ | ||
{ | ||
path: '', | ||
component: NbPlaygroundComponent, | ||
children: [ | ||
{ path: 'popover', component: NbPopoverExampleComponent }, | ||
], | ||
}, | ||
]; | ||
|
||
@NgModule({ | ||
imports: [RouterModule.forChild(routes)], | ||
exports: [RouterModule], | ||
}) | ||
export class NbPlaygroundRoutingModule { | ||
} |
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,22 @@ | ||
/** | ||
* @license | ||
* Copyright Akveo. All Rights Reserved. | ||
* Licensed under the MIT License. See License.txt in the project root for license information. | ||
*/ | ||
|
||
import { Component, OnInit } from '@angular/core'; | ||
import { NbThemeService } from '@nebular/theme'; | ||
|
||
@Component({ | ||
selector: 'nb-playground', | ||
template: '<router-outlet></router-outlet>', | ||
}) | ||
|
||
export class NbPlaygroundComponent implements OnInit { | ||
constructor(private themeService: NbThemeService) { | ||
} | ||
|
||
ngOnInit() { | ||
this.themeService.changeTheme('default'); | ||
} | ||
} |
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,50 @@ | ||
/** | ||
* @license | ||
* Copyright Akveo. All Rights Reserved. | ||
* Licensed under the MIT License. See License.txt in the project root for license information. | ||
*/ | ||
|
||
import { NgModule } from '@angular/core'; | ||
import { CommonModule } from '@angular/common'; | ||
import { NbCardModule, NbLayoutModule, NbPopoverModule } from '@nebular/theme'; | ||
|
||
import { NbPlaygroundRoutingModule } from './playground-routing.module'; | ||
import { NbPlaygroundComponent } from './playground.component'; | ||
import { NbPopoverExampleComponent } from './examples'; | ||
import { NbDynamicToAddComponent } from '../app/dynamic.component'; | ||
|
||
export const NB_MODULES = [ | ||
NbCardModule, | ||
NbLayoutModule, | ||
NbPopoverModule, | ||
]; | ||
|
||
export const NB_EXAMPLE_COMPONENTS = [ | ||
NbPopoverExampleComponent, | ||
]; | ||
|
||
export const NB_ENTRY_COMPONENTS = [ | ||
NbDynamicToAddComponent, | ||
]; | ||
|
||
@NgModule({ | ||
imports: [ | ||
CommonModule, | ||
NbPlaygroundRoutingModule, | ||
...NB_MODULES, | ||
], | ||
exports: [ | ||
...NB_ENTRY_COMPONENTS, | ||
...NB_EXAMPLE_COMPONENTS, | ||
], | ||
declarations: [ | ||
NbPlaygroundComponent, | ||
...NB_ENTRY_COMPONENTS, | ||
...NB_EXAMPLE_COMPONENTS, | ||
], | ||
entryComponents: [ | ||
...NB_ENTRY_COMPONENTS, | ||
], | ||
}) | ||
export class NbPlaygroundModule { | ||
} |