Skip to content

Commit

Permalink
Merge branch 'master' into move-more-things-to-core
Browse files Browse the repository at this point in the history
  • Loading branch information
igor-dv authored Jan 20, 2018
2 parents f7f4194 + 4886eff commit 01bed1c
Show file tree
Hide file tree
Showing 5 changed files with 78 additions and 1 deletion.
1 change: 0 additions & 1 deletion examples/angular-cli/src/stories/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,6 @@ storiesOf('Welcome', module).add('to Storybook', () => ({
storiesOf('Button', module)
.add('with text', () => ({
moduleMetadata: {
entryComponents: [Button, Welcome],
declarations: [Button, Welcome],
},
props: {
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
// Jest Snapshot v1, https://goo.gl/fbAQLP

exports[`Storyshots Inheritance base button 1`] = `
<storybook-dynamic-app-root
cfr={[Function CodegenComponentFactoryResolver]}
data={[Function Object]}
target={[Function ViewContainerRef_]}
>
<storybook-base-button>


<button>
this is label
</button>


</storybook-base-button>
</storybook-dynamic-app-root>
`;

exports[`Storyshots Inheritance icon button 1`] = `
<storybook-dynamic-app-root
cfr={[Function CodegenComponentFactoryResolver]}
data={[Function Object]}
target={[Function ViewContainerRef_]}
>
<storybook-icon-button>


<button>
this is label - this is icon
</button>


</storybook-icon-button>
</storybook-dynamic-app-root>
`;
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
import { Component, Input } from '@angular/core';

@Component({
selector: `storybook-base-button`,
template: `
<button>{{label}}</button>
`,
})
export class BaseButtonComponent {
@Input() label: string;
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
import { Component, Input } from '@angular/core';
import { BaseButtonComponent } from './base-button.component';

@Component({
selector: `storybook-icon-button`,
template: `
<button>{{label}} - {{icon}}</button>
`,
})
export class IconButtonComponent extends BaseButtonComponent {
@Input() icon: string;
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
import { storiesOf } from '@storybook/angular';
import { IconButtonComponent } from './icon-button.component';
import { BaseButtonComponent } from './base-button.component';

storiesOf('Inheritance', module)
.add('icon button', () => ({
component: IconButtonComponent,
props: {
icon: 'this is icon',
label: 'this is label',
},
}))
.add('base button', () => ({
component: BaseButtonComponent,
props: {
label: 'this is label',
},
}));

0 comments on commit 01bed1c

Please sign in to comment.