In my app I have a slidebox style interface. In one of the slides, I want to show a certain thing conditionally (ie if Meteor.user().profile.asdf
). I want to show the exact same page via navigation from a link on the main page (so if you're at the URL /item/123
). How can I do this without duplicating all of my code? More specifically, in my router I have:
.state('item', {
url: '/item/:itemId',
templateUrl: 'client/templates/itemView.html',
controller: 'itemViewCtrl as item',
resolve : {
liftId : ['$stateParams', function($stateParams){
// console.log($stateParams.liftId);
return $stateParams.liftId;
}]
}
})
On the page accessed via the URL I access the data through item.helper.whatever. Is there a shortcut to include this page in the main page as an <ng-include src="'client/templates/itemView.html'"></ng-include>
or something?