【发布时间】:2016-05-19 08:20:35
【问题描述】:
我在 cloud9 IDE 下运行这个应用程序。流星1.3.2.4
流星列表:
角度 1.3.10
自动发布 1.0.7
es5-shim 4.5.10
不安全的 1.0.7
jQuery 1.11.8
流星基地 1.0.4
移动体验 1.0.4
mongo 1.1.7
反应变量 1.0.9
标准-minifier-css 1.0.6
跟踪器 1.0.13
我的 ./client/main.html
<head>
<title>Joakenpo</title>
</head>
<body ng-app="joakenpo">
<h1>Joakenpo</h1>
<div ng-controller="MainCtrl">
<ul>
<li ng-repeat="person in list">{{person.name}}</li>
</ul>
</div>
</body>
我的 ./server/main.js
List = new Mongo.Collection('list');
Meteor.startup(() => {
console.log('Joakenpo running');
['John', 'Peter', 'Rachel'].map((name) => List.insert({ name: name }));
console.log(List.find().count());
});
我的 ./client/main.js
angular
.module('joakenpo', ['angular-meteor'])
.controller('MainCtrl', ($log, $scope) => {
$log.debug('main controller');
$scope.message = 'Module running';
$scope.helpers({
list() {
return Meteor.List.find({});
}
});
})
.run(($log) => $log.debug('Joakenpo Module Running'));
我的错误
angular_angular.js?hash=c17a5a9…:12535 TypeError: Cannot read property 'find' of undefined
【问题讨论】:
标签: angularjs mongodb meteor collections angular-meteor