Angular-fullstack: PostgreSQL 数据库已创建,但无法获取数据
Angular-fullstack: PostgreSQL DB created, but can't get data
我是 angularjs 的新手,我正在尝试使用 yeoman 和 PostgreSQL 使用 generator-angular-fullstack 设置第一个项目。一切似乎都有效。
当我在本地主机上使用 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
};
我已经想出来了,在index.html代码中是bug/mistake
<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 是
SELECT "id", "title", "info", "active", "createdAt", "updatedAt" FROM "Things" AS "Thing";
没有thing.name字段,所以在ng-repeat中没有显示。
我是 angularjs 的新手,我正在尝试使用 yeoman 和 PostgreSQL 使用 generator-angular-fullstack 设置第一个项目。一切似乎都有效。
当我在本地主机上使用 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
};
我已经想出来了,在index.html代码中是bug/mistake
<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 是
SELECT "id", "title", "info", "active", "createdAt", "updatedAt" FROM "Things" AS "Thing";
没有thing.name字段,所以在ng-repeat中没有显示。