我是棱角分明的新手,我正在尝试使用ES6.
我有依赖注入的问题,我无法让它工作.
我的index.js:
import './index-state.css!';
import angular from 'angular';
import 'angular-ui-router';
import IndexStateController from './index-state-controller';
import indexRouteConfig from './index-route';
const dependencies = [
'ui.router'
];
export default angular
.module('index-state-component', dependencies)
.controller('IndexStateController', IndexStateController)
.config(indexRouteConfig);
我的index-state.controller.js是:
class IndexStateController {
constructor($timeout) {
this.$timeout = $timeout;
this.controllerName = 'Example Controller';
console.log(this.$timeout);
}
}
IndexStateController.$inject =['$timeout'];
export default [
IndexStateController
];
我在console.log上得到'undefined'(这个.$ timeout).
有人可以帮我解决这个问题吗?
谢谢
我的 Postgres 数据库是一个多模式数据库。每个模式都有相同的结构,但数据不同。
自从我遇到一个特定问题以来,它工作得很好。看来视图是根据当前的search_path生成的。
假设我的数据库是这样的:
如果我SET search_path TO schema1, public。然后SELECT * FROM schema1.view;
它将从公共模式中检索数据。
我尝试在生成视图之前更改 search_path,但没有成功。我尝试将我的表添加到我的视图中,它起作用了。我的解决方案是在使用“新数据库”脚本创建视图之前添加目标架构前缀。但我觉得它有点“脏”;
我很想对这个主题有更多的了解!
谢谢