0

I need how to load dynamically page loading in same page using meteor js.I will develop for Admin panel ,after login Admin display admin details dynamically with same template page.

2 Answers 2

2

You can put the details in a conditional:

<template name="example">
    {{#if admin}}
        Admin details
    {{/if}}
</template>

 

Template.example.admin = function() {
    return Meteor.user() && Meteor.user().admin;
};
Sign up to request clarification or add additional context in comments.

Comments

1

I'd suggest you use routes for this. This also allows you to control what other users see when they aren't admin and redirect, etc. instead of using a crazy number of conditional statements. For an example of an admin interface that is actually added via a smart package, see the following files, which use iron-router:

https://github.com/HarvardEconCS/turkserver-meteor/blob/master/admin/clientAdmin.html https://github.com/HarvardEconCS/turkserver-meteor/blob/master/admin/clientAdmin.coffee

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.