【发布时间】:2013-09-24 15:18:15
【问题描述】:
我从 GitHub API 获得了用户名和电子邮件地址。但它没有显示在 Meteor 中。它适用于 profile.name 但不适用于 services.github.username 或电子邮件
Template.input_box.events = {
"keydown input#message" : function(event){
if (event.which == 13) {
// 13 is the enter key event
if (Meteor.user())
{
var name = Meteor.user().profile.name;
// var git_userid = Meteor.user().services.github.username;
// var git_email = Meteor.user().services.github.email;
}
这很奇怪,因为 Meteor.user().services.github.username;在控制台模式下工作,但如果我输入我的代码并在本地主机中运行,它不会显示任何内容......调用这个的代码
{{git_email}} {{git_userid}} // does not work
{{name}} // works
如何使它们工作,以便我可以在我的 HTML 中插入电子邮件和用户名信息。
谢谢
【问题讨论】:
标签: javascript html github meteor meteorite