我是angularjs的新手,我正在尝试使用yeoman和PostgreSQL设置第一个使用生成器-角度-全栈的项目。一切似乎都很正常。
当我在localhost上使用grunt (grunt serve)时,我看到一个基本的yeoman页面,但没有数据。创建数据库和表。这里有一些测试数据。从项目到数据库的连接看起来正常工作,但它无法访问数据。
Development.js中的数据库配置:
module.exports = {
// MongoDB connection options
mongo: {
uri: 'mongodb://localhost/fullstack-dev'
},
// Postgres connection options
postgres: {
uri: process.env.POSTGRES_URL ||
'postgres://user:pass@localhost:5432/testDB'
},
database: 'testDB',
username: 'postgres',
password: 'postgres',
seedDB: true
};screens pgadmin DB screenshot index.html screenshot
发布于 2016-08-22 15:18:25
我已经弄清楚了,这是index.html代码中的错误
<div class="container">
<div class="row">
<div class="col-lg-12">
<h1 class="page-header">Features:</h1>
<ul class="nav nav-tabs nav-stacked col-md-4 col-lg-4 col-sm-6" ng-repeat="thing in awesomeThings">
<li><a href="#" tooltip="{{thing.info}}">{{thing.name}}</a></li>
</ul>
</div>但是从数据库中选择是
SELECT "id", "title", "info", "active", "createdAt", "updatedAt" FROM "Things" AS "Thing";因为没有thing.name字段,所以在ng-repeat中没有要显示的内容。
https://stackoverflow.com/questions/39073069
复制相似问题