<script src="https://ajax.googleapis.com/ajax/libs/angularjs/1.2.23/angular.min.js"></script>
<div ng-app="DummyApp">
<div ng-controller="DummyController">
<form>
<div class="form-group">
<label for="filterName">Filter by name</label>
<input type="text" class="form-control" id="filterName" ng-model="filterName">
</div>
<div class="form-group">
<label for="filterTags">Filter by tags</label>
<input type="text" class="form-control" id="filterTags" ng-model="filterTag">
</div>
</form>
<div class="col-md-7 articles">
<section>
<div class="card filter" ng-repeat="article in articles_data | filter:filterName | filter:filterTag">
<div class="card-header">
{{article.title}} <small>{{article.tags.join()}}</small>
<span class="badge badge-{{article.category}} float-right">{{article.category}}</span>
</div>
<div class="card-body">
<p>
{{article.description}}
</p>
</div>
</div>
</section>
</div>
</div>
</div>
app.get("/logs", (req, res) => {
Log.find({}, (err, logs) => {
if(err){
console.log("ERROR!" + err );
} else {
res.render("index", {logs: logs});
}
});
});
我该如何进行这项工作。我在ejs端遇到 app.get("/logs", (req, res) => {
DailyTask.find(
{"created_on":{"$gte":startOfToday, "$lt": now}},(err, tasks) =>{
if(err){
console.log("ERROR => " + err);
} else {
res.render("index", {tasks: tasks});
}
});
});
错误。任何帮助表示赞赏!
谢谢