title: Cannot read property 'createText' of null
body: <p>I am very new to angular. I have a modal that pops up clicking a button and as I need this(button and modal) in several other places and I have created a separate component for that but unfortunately I am getting the above-mentioned error.</p>
  <p>modal.component</p>
  <p><div class="snippet" data-lang="js" data-hide="false" data-console="true" data-babel="false">
  <div class="snippet-code">
  <pre class="snippet-code-js lang-js prettyprint-override"><code>export class NotificationModalComponent {
      
      msgRef: BsModalRef;
  
  
    constructor(private modalService: BsModalService ) { }
      getNotify(template?:TemplateRef&lt;any&gt;){
      this.msgRef = this.modalService.show(template);
    }</code></pre>
  <pre class="snippet-code-html lang-html prettyprint-override"><code>&lt;button (click)="popsModal('msgmodal')"&gt;
  &lt;ng-template #msgmodal&gt;
    &lt;div class="modal-body text-center"&gt;
      &lt;h3&gt;Allow Notifications&lt;/h3&gt;
      &lt;small&gt;Click allow to get push notifications&lt;/small&gt;
    &lt;/div&gt;
  &lt;/ng-template&gt;</code></pre>
  </div>
  </div>
  </p>
  <p>otherParentComponet</p>
  <pre><code>&lt;app-modal&gt;&lt;/app-modal&gt;
  </code></pre>