title: How to dynamically load a custom component in nativescript?
body: <p>I am new to nativescript, and I am trying to dynamically load a custom component when I tap on button,
  But I get this error: </p>
  
  <blockquote>
    <p>Error: Module 
    '/data/data/org.nativescript.DMMobileApp01/files/app/components' not 
    found for element 'components:Test'  com.tns.NativeScriptException:
    Failed to find module:<br>
    "/data/data/org.nativescript.DMMobileApp01/files/app/components", >
    relative to: app//</p>
  </blockquote>
  
  <p>I have searched a lot but most issues and tutorials that related to dynamically load a custom component are around angular and webpack.</p>
  
  <p>This function which responsible to dynamic loading of the custom component:</p>
  
  <pre><code>function toSettings(args){
      const page = args.object.page;
      const mainScene = page.getViewById('mainScene'); 
      let settingsCompo = builder.load({
          path: '~/components',
          name: 'test'
      });
  }
  </code></pre>
  
  <p>And this is the app/components/test.xml file</p>
  
  <pre><code>&lt;StackLayout orientation="horizontal"&gt;
      &lt;Label text="yaaaay!" textWrap="true" /&gt;
  &lt;/StackLayout&gt;
  </code></pre>
  
  <p>I expect it is an easy task but I don't know why I am getting this error! Where is my missing part?</p>