Skip to content
This repository has been archived by the owner on Feb 26, 2024. It is now read-only.

Loading only specified components #207

Open
ThorstenHans opened this issue Mar 24, 2015 · 2 comments
Open

Loading only specified components #207

ThorstenHans opened this issue Mar 24, 2015 · 2 comments

Comments

@ThorstenHans
Copy link

When building an app with two viewports like

<div ng-viewport="nav"></div>
<div ng-viewport="content"></div>

and having a $router configuration like this

$router.config([
{ path: '/', components: {'nav' : 'navigation', 'content' : 'splash' },
{ path: '/users', components: {'content': 'users'}
]);

will end up in an exception because the new rounter doesn't find a definition for the content viewport in my route config.

I know that's possible to configure another route within the navigation but I'd like to keep it clean. and place all the route configurations in the AppController itself.

Providing a router config like

$router.config([
{ path: '/', components: {'nav' : 'navigation', 'content' : 'splash' },
{ path: '/users', components: {'nav' : 'navigation', 'content': 'users'}
]);

works of course, but with this solution the content of nav will be reloaded. Is there any way to either update only specified viewports or to prevent a viewport from beeing re-initialized when the same component will be injected?

@btford
Copy link
Contributor

btford commented Mar 28, 2015

the content of nav will be reloaded.

I think this is not the correct behavior.

I'm working on making defaults around component reuse a bit more sane. Will follow up with more soon.

@btford btford added this to the 0.7.0 milestone Mar 28, 2015
@ThorstenHans
Copy link
Author

nice, thx

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

2 participants