Quantcast
Channel: JavaScriptMVC Forum
Viewing all articles
Browse latest Browse all 3491

StealJS: wait for main to load

$
0
0
If I have on the page


  1. <script src="/bower_components/steal/steal.js" main="app/component/my-component/" config="/stealconfig.js"></script>
Is it possible to wait for  app/component/my-component/ be loaded on the page and then append it to the DOM?

I thought to add next line:

  1.         <script>

  2.             System.import('app/component/my-component/').then(function(){

  3.                 $(function(){

  4.                     $('body').append(can.stache('<my-component></my- component >')())

  5.                 })
  6.             })

  7.         </script>
But it seems not to work. Some times 'apps/common/promo-page/' is loaded even before stealconfig

Viewing all articles
Browse latest Browse all 3491

Trending Articles