title: Angular6 Custom PopUp
body: <p>I Am trying to make a popup window having input fields and buttons. following is the code </p>
  
  <p><strong>Parent Component.html</strong></p>
  
  <pre><code>&lt;div class="form-group"&gt;
   &lt;button type="submit" class="btn btn-success" (click)="onClickEa()"&gt;Add &lt;/button&gt;           
  &lt;/div&gt;
  </code></pre>
  
  <p><strong>Parent component.ts</strong></p>
  
  <pre><code>import { Component, OnInit, AfterViewInit } from '@angular/core';
  import { NgbModal, NgbActiveModal } from '@ng-bootstrap/ng-bootstrap';
  import { ConfigPopupComponent } from '../config-popup/config-popup.component';
  @Component({
      selector: 'app-providerservice',
      templateUrl: './providerservice.component.html',
      styleUrls: ['./providerservice.component.css']
  })
  export class ProviderserviceComponent implements OnInit, AfterViewInit {
       constructor(private modalService: NgbModal) { }
      ngAfterViewInit(): void {
          this.open();
      }
      open() {
          const modalRef = this.modalService.open(ConfigPopupComponent);
  
    }
  }
  </code></pre>
  
  <p><strong>popup component.html</strong></p>
  
  <pre><code>&lt;div&gt;
     popup worked
  &lt;/div&gt;
  </code></pre>
  
  <p><strong>app.module.ts</strong></p>
  
  <pre><code>import { BrowserModule } from '@angular/platform-browser';
  import { NgModule } from '@angular/core';
  import { RouterModule, Routes } from '@angular/router';
  import { FormsModule } from '@angular/forms';
  
  import { AppComponent } from './app.component';
  import { ConfigPopupComponent } from './config-popup/config-popup.component';
  
  const appRoutes: Routes = [
    { path: 'xeservice', component: XeserviceComponent },
    {path: 'providerservice', component: ProviderserviceComponent}
  ];
  @NgModule({
    declarations: [
      AppComponent,
      MainComponent,
      XeserviceComponent,
      EaConfigPopupComponent
    ],
    imports: [
      BrowserModule,
      RouterModule.forRoot(appRoutes),
      FormsModule,
  
    ],
    exports: [RouterModule],
    entryComponents: [ ConfigPopupComponent ],
    providers: [],
    bootstrap: [AppComponent]
  
  })
  export class AppModule { }
  </code></pre>
  
  <p>When I click on the add button from the parent view child component should be show as a popup. previously i had some error at that time I added popup component as an entry component.but still  have the error. 
  <a href="https://i.stack.imgur.com/8HuF4.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/8HuF4.png" alt="enter image description here"></a>
  anybody, please help</p>