Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- //JS file
- Meteor.users.insert({
- username: 'admin',
- profile: {
- first_name: 'Clark',
- last_name: 'Kent'
- },
- });
- // HTML view
- {{Meteor.user().username}}
- {{Meteor.user().profile.first_name}}
- {{Meteor.user().profile.last_name}}
- <template name="user">
- <p>{{firstName}}</p>
- </template>
- Template.user.helpers({
- firstName: function() {
- return Meteor.user().profile.first_name;
- }
- });
- {{#if currentUser}}
- {{> user}}
- {{/if}}
- {{#with currentUser}}
- {{#with profile}}
- {{first_name}}
- {{/with}}
- {{/with}}
- {{#with userDetails}}
- First name:-{{this.first_name}}
- Last name:- {{this.last_name}}
- {{/with}}
- //jsSide
- userDetails(){
- return Meteor.user();
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement