Or, just use ng-include.
I have an optional sidebar on every page of my app, so there's an element
on my index page that uses ng-include and points to the variable template
it's assigned to. The top-controller scope, that's alway there regardless
of route (MainCtrl), has the sidebar object reference for showing it or
not, and which template to include. It's scope is available to each of the
child controllers loaded on route change (for better or worse), so they can
turn it on/off and set the template that should be included.
<div class="app-container" ng-class="{'has-sidebar': sidebar.shown}">
<!-- side message -->
<aside class="info-sidebar" ng-show="sidebar.shown"
ng-include="sidebar.template"></aside>
On Tuesday, August 18, 2015 at 8:58:52 PM UTC-6, jamie wrote:
>
> You can use ngRoute and ngView to display your high level pages (sales,
> payment, delivery, receipt) and have each defined with their own
> controller. Create a directive to generate the side panel (for each
> element applicable to the page, add a link) and then have it call a
> function that sets the selected item on the controller for that page.
>
> From there, include the appropriate html template for that page when the
> user makes the selection.
>
--
You received this message because you are subscribed to the Google Groups
"AngularJS" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
To post to this group, send email to [email protected].
Visit this group at http://groups.google.com/group/angular.
For more options, visit https://groups.google.com/d/optout.