Skip to content

Child Component not loading after adding CUSTOM_ELEMENTS_SCHEMA to the app module #7017

@jameelvm

Description

@jameelvm

I have a component named HostComponent , when I put this component as a start up component everything is working and my application working fine.

Then I create one more module called AppModule and Wrap the host component inside the app component

import { Component, Input } from '@angular/core';
@Component({
  selector: 'main-app',
  template: '<ds-framework-host >Loading...</ds-framework-host>'
})
export class AppComponent {
constructor(){

}
}

AppModule

@NgModule({
  declarations: [
    AppComponent
  ],
  imports: [
    BrowserModule,
    FormsModule,
    ,
  ],
  schemas:[],
  bootstrap: [AppComponent],
  entryComponents: [
     SomeOtherEntryComponentsHere
  ]
})
export class AppModule {

}

Index.html

<body>
           <main-app></main-app>
</body>

When I try to run the application I am getting the below error
https://i.stack.imgur.com/viD9o.png

To suppress this error I have added CUSTOM_ELEMENTS_SCHEMA to app module based on the below reference.

My error goes way but my <ds-framework-host> shows loading.. but nothing is executing inside this child component. In developer tools no error is showing

Angular Version - 4.0.0.0

 "dependencies": {
    "@angular/common": "^4.0.0",
    "@angular/compiler": "^4.0.0",
    "@angular/core": "^4.0.0",
    "@angular/forms": "^4.0.0",
    "@angular/http": "^4.0.0",
    "@angular/platform-browser": "^4.0.0",
    "@angular/platform-browser-dynamic": "^4.0.0",
    "@angular/router": "^4.0.0",
    "bootstrap": "^4.0.0-alpha.6",
    "core-js": "^2.4.1",
    "jquery": "^3.2.1",
    "rxjs": "^5.1.0",
    "zone.js": "^0.8.4"
  }

How Can I resolve this error and why it's happening?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions