0

I am trying to split a component I have in three. So I created a new component, template, etc... Now I need to include the children components into the main component in order to make children selectors work.

I learned that component directives is deprecated and I must use NgModule instead, however I don't understand how to do it: the current NgModule is in the main file and my component is in another file. I created a new NgModule (I don't know if it makes sense or is allowed) like that:

@NgModule({
  declarations: [
    ForgotPasswordComponent,
  ],
  bootstrap: [Login]
})

@Component({
  selector: 'login',
  styleUrls: [ './login.style.scss' ],
  templateUrl: './login.template.html',
  encapsulation: ViewEncapsulation.None,
  host: {
    class: 'login-page app'
  }
})
export class Login {
  ...
}

I believe it is a stupid (syntax) error but I can't figure it out.

fred00
  • 571
  • 2
  • 8
  • 23

1 Answers1

0

I figure it out: I added in the module file a @NgModule and there I included the ForgotPasswordComponent declaration.

fred00
  • 571
  • 2
  • 8
  • 23