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

Problem with @NgModule Decorator while importing Modules from other project #298

Open
tkarzewski opened this issue Feb 23, 2017 · 1 comment

Comments

@tkarzewski
Copy link

Cool Scaffold you built there! I like :-)

Unfortunately I am facing problems when I want to develop and import several projects and got this error: bundle() requires a decorated NgModule as its first argument.
For example I have a project my-shared-app with a ListComponent. I want to use this ListComponent in my project my-main-app.

my-main-app -> my-shared-app

For local development I use npm link to link the repos, but for example purpose I created those repos:

In my-main-app I adjusted following files

vendor.js

import 'my-shared-app';

app.module.ts

import { NgModule } from 'ng-metadata/core';
import { AppComponent } from './app.component';
import { MySharedAppModule } from 'my-shared-app';

@NgModule( {
  imports: [
    MySharedAppModule
  ],
  declarations: [
    AppComponent
  ]
} )
export class MyMainAppModule {
}

app.component.js

import { Component } from 'ng-metadata/core';

@Component({
  selector: 'np-app',
  template: `
    <h1>Main Module</h1>
    <np-list [entries]="$ctrl.entries"></np-list>
  `
})
export class AppComponent {

  entries = [
    { id: 1, label: 'Entry 1' },
    { id: 2, label: 'Entry 2' },
    { id: 3, label: 'Entry 3' },
    { id: 4, label: 'Entry 4' },
  ]

}

Do you see, what I'm doing wrong? Any suggestions?
Thx for help! :-)

@aciccarello
Copy link

I think this belongs in the https://github.com/ngParty/ng-metadata repo. There's also a slack channel you can refer to.

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

No branches or pull requests

2 participants