title: ngOnInit and data binding not working in ModalView NativeScript Angular
body: <p>I am searching sincerely since 2 days and trying to fix that problem due to lack of knowledge. I have started Nativescript recently and I am intermediate with Angular.</p>
  
  <h1> Problem</h1>
  
  <ul>
  <li>I am trying to open the modal <code>ShopInfosComponent</code> in my <code>map.component.ts</code> : </li>
  </ul>
  
  <pre><code>const options: ModalDialogOptions = {
        viewContainerRef: this.viewContainerRef,
        fullscreen: false,
        context: {},
      };
  
      this.modalService.showModal(ShopInfosComponent, options);
  
  </code></pre>
  
  <p><code>ShopInfosComponent</code> belongs to the <code>BrowseModule</code> where I understand that I need to add it to </p>
  
  <pre><code>@NgModule({
      imports: [
          NativeScriptCommonModule,
          BrowseRoutingModule,
      ],
      declarations: [
          BrowseComponent,
          MapComponent,
          ShopInfosComponent
      ],
      entryComponents: [ShopInfosComponent]
  })
  
  </code></pre>
  
  <p>BrowseModule belongs to the upper Module <code>AppModule</code>.</p>
  
  <h1>Real Problem :</h1>
  
  <p>The modal <code>ShopInfosComponent</code> successfully opens as intented, but there is <strong>no data binding</strong>, actually <strong><code>ngOnInit</code> is not called</strong> (unlike the constructor).</p>
  
  <p>This is the content of the modal <code>shop-infos.component.html</code>: </p>
  
  <pre><code>&lt;StackLayout&gt;
      &lt;Label [text]="result"&gt;&lt;/Label&gt;
      &lt;Label text="Static Text"&gt;&lt;/Label&gt;
  &lt;/StackLayout&gt;
  
  </code></pre>
  
  <h1>What I've tried</h1>
  
  <p>I've tried to open a modal directly inside <code>AppModule</code> with the <code>app.component.ts</code>, which weirdly works !
  It's only not working when putting inside another module which is imported by <code>AppModule</code>.</p>
  
  <p>The app template used is the <a href="https://market.nativescript.org/plugins/tns-template-drawer-navigation-ng" rel="nofollow noreferrer">Navigation Drawer</a> from Nativescript.</p>
  
  <p>Maybe it's a problem with the lazy loading app routing ?</p>
  
  <p>I've uploaded the app graphic documentation and source code on my website : <a href="https://luiswillnat.eu/stack/nativescript/databinding/" rel="nofollow noreferrer">https://luiswillnat.eu/stack/nativescript/databinding/</a></p>
  
  <p>Please feel free to use, I am really willing to find the solution and to learn from it.</p>
  
  <p><a href="https://i.stack.imgur.com/cGK4m.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/cGK4m.png" alt="enter image description here"></a></p>