-
-
Notifications
You must be signed in to change notification settings - Fork 9.4k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Angular - Add component story with dependencies #2514
Comments
What is the angular version in this case ? Can you elaborate where the error is happening ? |
@igor-dv It's angular 5.0.0 |
I've added a PR to fix this. Thanks ! |
Amazing, man! |
@igor-dv Found the same behavior for apply a directive with input Code Snippets// Directive
import { Directive, Input } from '@angular/core';
@Directive({
selector: '[appCustomDirective]'
})
export class CustomDirectiveDirective {
@Input() directiveAttr: number;
}
// Component
import { Component, OnInit, Directive } from '@angular/core';
@Component({
selector: 'selector-name',
template: `<div appCustomDirective [directiveAttr]='"foobar"' >has directive with attr</div>`
})
export class NameComponent {}
// Story
import { storiesOf } from '@storybook/angular';
storiesOf('NameComponent', module)
.add('with text', () => ({
component: NameComponent,
props: { }
})) Console error
|
Yup, @noratodaitan, we have a solution coming that will allow people to inject schemas, providers et al (basically everything you can include in a NgModule). |
That sounds great, I will write more tests here. |
@noratodaitan here's the PR #2526 |
Issue details
I had some errors when I try to create a story for a component that has dependencies, like pipes and directives.
Version of Storybook and optionally any affected addons that you're running
Code Snippets
Returns the dependency injection error
The text was updated successfully, but these errors were encountered: