-2

I need to call a component in src from node_modules but using the selector won't work.

I tried adding the component to be accessed in sharedModule and have it imported at app.module.ts.

Roan
  • 63
  • 2
  • 7
  • 1
    show us your `module.ts` files. Plus this is likely a duplicate e.g. https://stackoverflow.com/questions/39601784/angular-2-use-component-from-another-module – Andrew Allen Aug 09 '19 at 07:05
  • Need more code and the name of the dependency in node_modules – Alber Aug 09 '19 at 07:07
  • I tried putting the component in declarations and exports, but it did not work either. – Roan Aug 09 '19 at 07:08

1 Answers1

0

in the app.module.ts you import Modules and components. i.e.:

import { NgModule } from '@angular/core';
import { BrowserModule } from '@angular/platform-browser';

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

@NgModule({
  declarations: [
    MyComponent
  ],
  imports: [
    BrowserModule
  ],
  providers: [],
  bootstrap: []
})

But I think, this is something you already know.

fr43nk
  • 129
  • 5