Warning: file_get_contents(/data/phpspider/zhask/data//catemap/9/javascript/468.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181

Warning: file_get_contents(/data/phpspider/zhask/data//catemap/8/meteor/3.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Javascript 流星及;铁路由器{{>;产量}未拉入模板_Javascript_Meteor_Iron Router - Fatal编程技术网

Javascript 流星及;铁路由器{{>;产量}未拉入模板

Javascript 流星及;铁路由器{{>;产量}未拉入模板,javascript,meteor,iron-router,Javascript,Meteor,Iron Router,编辑:我运行了流星添加ejson,这就解决了它 我松散地跟随DiscoveryMeteor来构建我自己的应用程序。我刚刚实现了iron router,现在我的模板没有拉入数据。我检查了数据库,数据就在那里。答案可能是显而易见的,但我已经把代码读了100遍了,还是弄不明白。如果我将{{>yield}改回{{>dealsList},效果很好 Layout.html <template name="layout"> <div class="container"> &

编辑:我运行了流星添加ejson,这就解决了它

我松散地跟随DiscoveryMeteor来构建我自己的应用程序。我刚刚实现了iron router,现在我的模板没有拉入数据。我检查了数据库,数据就在那里。答案可能是显而易见的,但我已经把代码读了100遍了,还是弄不明白。如果我将{{>yield}改回{{>dealsList},效果很好

Layout.html

<template name="layout">
  <div class="container">
    <header class="navbar navbar-default" role="navigation">
      <div class="navbar-header">
        <a class="navbar-brand" href="{{pathFor 'dealsList'}}">swigFU</a>
      </div>
    </header>
    <div id="main">
      {{> yield}}
    </div>
  </div>
</template>
deals\u list.html

<template name="dealsList">
  <div class="posts page">
    {{#each deals}}
      {{> dealItem}}
    {{/each}}
  </div>
</template>

您必须在控制台中执行此操作:meteor add ejson。看看这个:谢谢,伙计,是的,我把头发拔了几个小时后才发现。你觉得我的评论有用吗?那样的话,你能标记一下吗?谢谢
<template name="dealsList">
  <div class="posts page">
    {{#each deals}}
      {{> dealItem}}
    {{/each}}
  </div>
</template>
Exception in callback of async function: ReferenceError: EJSON is not defined
    at MiddlewareStack.concat (http://localhost:3000/packages/iron_middleware-stack.js?ff70621b6c5f6a406edc60600c4b76126dae21d6:303:25)
    at RouteController._runRoute (http://localhost:3000/packages/iron_router.js?dd5fa02859b6335661b94134bd9903be8eecf44d:542:17)
    at Function.Route.dispatch (http://localhost:3000/packages/iron_router.js?dd5fa02859b6335661b94134bd9903be8eecf44d:856:18)
    at route (http://localhost:3000/packages/iron_router.js?dd5fa02859b6335661b94134bd9903be8eecf44d:713:11)
    at boundNext (http://localhost:3000/packages/iron_middleware-stack.js?ff70621b6c5f6a406edc60600c4b76126dae21d6:425:31)
    at http://localhost:3000/packages/meteor.js?637cc835a2ee4a2302a010c9a4c97b906db5f41c:1007:22
    at dispatch (http://localhost:3000/packages/iron_middleware-stack.js?ff70621b6c5f6a406edc60600c4b76126dae21d6:449:3)
    at http://localhost:3000/packages/iron_router.js?dd5fa02859b6335661b94134bd9903be8eecf44d:393:13
    at Tracker.Computation._compute (http://localhost:3000/packages/tracker.js?16c53d4f91467c6a41bbb860bf6c48f871710022:357:36)
    at new Tracker.Computation (http://localhost:3000/packages/tracker.js?16c53d4f91467c6a41bbb860bf6c48f871710022:245:10)