Skip to content

Commit

Permalink
fix(popover): fix popover component example (#711)
Browse files Browse the repository at this point in the history
Closes #618, Closes #619
  • Loading branch information
nnixaa authored Sep 13, 2018
1 parent a25f615 commit 9980664
Show file tree
Hide file tree
Showing 7 changed files with 22 additions and 5 deletions.
1 change: 1 addition & 0 deletions docs/structure.ts
Original file line number Diff line number Diff line change
Expand Up @@ -311,6 +311,7 @@ export const structure = [
icon: 'popover.svg',
source: [
'NbPopoverDirective',
'NbPopoverComponent',
],
},
{
Expand Down
4 changes: 2 additions & 2 deletions e2e/popover.e2e-spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -156,13 +156,13 @@ describe('nb-popover', () => {
it('have to render component with context', () => {
element(contentComponentWithContext).click();
const text = element(popover).element(by.css('nb-dynamic-to-add > div > strong')).getText();
expect(text).toEqual('hello from dynamically inserted component: Example context');
expect(text).toEqual('Hello from custom component: Example context');
});

it('have to render template with context', () => {
element(contentTemplateWithContext).click();
const text = element(popover).element(by.css('nb-dynamic-to-add > div > strong')).getText();
expect(text).toEqual('hello from dynamically inserted component: Example context');
expect(text).toEqual('Hello from custom component: Example context');
});

it('have to hide popover when host removed', done => {
Expand Down
5 changes: 3 additions & 2 deletions src/playground/popover/popover-custom-component.component.ts
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,9 @@ import { NbDynamicToAddComponent } from '../shared/dynamic.component';
selector: 'nb-popover-custom-component',
templateUrl: './popover-custom-component.component.html',
styles: [`
nb-layout-column {
height: 50vw;
:host {
display: block;
margin: 5rem;
}
`],
})
Expand Down
6 changes: 6 additions & 0 deletions src/playground/popover/popover-modes.component.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,12 @@ import { Component } from '@angular/core';
@Component({
selector: 'nb-popover-modes',
templateUrl: './popover-modes.component.html',
styles: [`
:host {
display: block;
margin: 5rem;
}
`],
})
export class NbPopoverModesComponent {
}
6 changes: 6 additions & 0 deletions src/playground/popover/popover-template-ref.component.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,12 @@ import { Component } from '@angular/core';
@Component({
selector: 'nb-popover-template-ref',
templateUrl: './popover-template-ref.component.html',
styles: [`
:host {
display: block;
margin: 5rem;
}
`],
})
export class NbPopoverTemplateRefComponent {
}
2 changes: 1 addition & 1 deletion src/playground/shared/dynamic.component.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import { Component, Input } from '@angular/core';
selector: 'nb-dynamic-to-add',
template: `
<div>
<strong>hello from dynamically inserted component: {{text}}</strong>
<strong>Hello from custom component: {{ text }}</strong>
</div>
`,
})
Expand Down
3 changes: 3 additions & 0 deletions src/playground/shared/shared.module.ts
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,9 @@ import { NbDynamicToAddComponent } from './dynamic.component';
declarations: [
NbDynamicToAddComponent,
],
entryComponents: [
NbDynamicToAddComponent,
],
})
export class NbPlaygroundSharedModule {
}

0 comments on commit 9980664

Please sign in to comment.