Skip to content
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] Dependency not resolving #3217

Closed
MatissJanis opened this issue Mar 15, 2018 · 2 comments
Closed

[Angular] Dependency not resolving #3217

MatissJanis opened this issue Mar 15, 2018 · 2 comments

Comments

@MatissJanis
Copy link
Contributor

MatissJanis commented Mar 15, 2018

Issue details

Component dependencies are not being resolved.

Expected: store dependency to be resolved.
Instead, this error is thrown:

Can't resolve all parameters for MyComponent: (?)

Steps to reproduce

Snippets below

Please specify which version of Storybook and optionally any affected addons that you're running

  • @storybook/angular: 3.4.0-alpha.7

Affected platforms

  • Angular 5.2.3

Screenshots / Screencast / Code Snippets (Optional)

// Component
import { Component } from '@angular/core';
import { Store } from '@ngrx/store';

@Component({
    selector: 'my-comp',
    templateUrl: './my-comp.component.html',
})
export class MyComponent {

    constructor(
      store: Store<any>,
    ) {
        console.log(store, store === undefined); // Response: `undefined true`
    }

}
// Story
import { storiesOf, moduleMetadata } from '@storybook/angular';
import { StoreModule } from '@ngrx/store';

import { MyComponent } from './my-component.component';

storiesOf('MyComponent', module)
    .addDecorator(moduleMetadata({
        imports: [
            StoreModule.forRoot({}),
        ],
        declarations: [
            MyComponent,
        ],
    }))
    .add('MyComponent', () => {
        return {
            component: MyComponent,
        };
    });
@igor-dv
Copy link
Member

igor-dv commented Mar 18, 2018

I've added an example usage with the @ngrx/store. You can take a look here, it's injected.

Maybe you can try the latest 3.4.0-rc2 release ?

@MatissJanis
Copy link
Contributor Author

Hey,

Yes, the issue is solved in the newest rc version! Thanks!

Sorry for not replying faster.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants