Open goldalworming opened 9 years ago
So are you expecting the HTML tag to be appended to a rg-view
tag of sorts?
Usage example:
<rg-view></rg-view>
rg.router.add({
name: 'about',
url: '/about',
tags: ['/tags/common/sidebar.tag', '/tags/views/about.tag', '/tags/common/footer.tag'],
history: false,
resolve: () => new Promise(function (resolve, reject) {
window.setTimeout(resolve, 2000)
})
})
what is window.setTimeout(resolve, 2000) used for? does resolve executed after 2 seconds? what if the js file not loaded after 2 seconds? or file loaded before 2 seconds?
does router still waited until 2 seconds?
Just an example promise you can tell the router to the wait for before going to the state.
The above is sample code to add a state rather than the inner workings of the router itself.
It's also an example of how it could work with a few adjustments to help you with your feature request 👍
Hi gregorypratt & goldalworming.
Please, could you give me an example for append content in
Thanks in advance Rodmar
does it support asynchronous load .tag file?
so it can be declared in router but not loaded yet, if url go to tags it load the tag then display the page, I usually use oclazyload in angular, if rg-router can have same feature it will be very good