我在一个页面中有两个 Angular 数据表。我正在从 Web 服务器(异步)获取数据。我为此创建了一个独立的组件。我的第一个表正确显示并绑定到排序和分页器,但第二个不起作用。虽然它显示了数据,但分页器和排序在第二个表上不起作用。任何想法可能是什么问题?
我的组件 TS 文件:
displayedColumns = ['customerId', 'projectId'];
@Input() dataSource2 = new MatTableDataSource<ScheduledTest>();
private paginator: MatPaginator;
private sort: MatSort;
@ViewChild(MatPaginator) set matPaginator(mp: MatPaginator) {
this.paginator = mp;
this.dataSource2.paginator = this.paginator;
}
@ViewChild(MatSort) set matSort(mp: MatSort) {
this.sort = mp;
this.dataSource2.sort = this.sort;
}
ngOnInit() {
this.getAllCurrentTestCases();
}
getAllCurrentTestCases() {
this.isError = false;
this.isLoading = true;
this.httpService.getAllCurrentTestCases(this.userService.accountNumber, this.userService.authToken)
.then((data: AutomatedTest[]) => {
this.isLoading = false;
this.dataSource2 = new MatTableDataSource<AutomatedTest>(data);
this.dataSource.sort = this.sort;
})
.catch(error => {
this.isError …Run Code Online (Sandbox Code Playgroud) 我想问一下在以下情况下为我的应用程序传递配置文件的首选方法或最佳方法是什么?
我的应用程序是在NodeJS上开发的,并且我有一个名为“ config.json”的JSON文件,其中包含应用程序的所有配置参数,即AD,SMTP,DB等。
{
"slackIncomingHook": [
{"HookUrl": "<<HookUrl>>"}
],
"wikiPage": {
"url": "<<url>>",
"timeFrame" : "week"
},
"database": {
"dbName": "DBNAME",
"dbHostName": "mongodb://username:password@<<IP Address>>:27017/"
}
}
Run Code Online (Sandbox Code Playgroud)
现在,我想使用Kubernetes部署此项目,并且我想在运行时将此信息传递给或在使用configMaps构建集群时以某种方式将其合并。
我对此项目的DockerFile包括复制两个单独的/相关项目,设置ENV,NPM安装并公开PORTS。
PS-Docker映像已推送到我的私有存储库。
专家建议,将不胜感激。