我有一个组件,它是延迟加载模块的一部分。
有没有办法 matDialog.open() 和延迟加载模块并显示组件?
export class testComponent implements OnInit {
constructor(
public matDialog: MatDialog,
private moduleLoader: NgModuleFactoryLoader
) {}
ngOnInit() {}
openModal() {
this.moduleLoader
.load("./modules/test-modal/test-modal.module#TestModalModule")
.then((module: NgModuleFactory<any>) => {
this.matDialog.open(/*insert component and load the module*/);
});
}
}
Run Code Online (Sandbox Code Playgroud) 我正在使用 Angular mat-tab-group 我如何强制 Angular 绑定非活动选项卡的 html 元素,下面是 html 实现
<mat-tab label="Test">
<app-test></app-test>
</mat-tab>
Run Code Online (Sandbox Code Playgroud)
test.component.ts 文件确实初始化并运行,但 html 元素未绑定,请查看下面的附图。有没有办法强制角度绑定它?我正在集成一些第 3 方库,该库要求在 component.ts 文件开始执行时绑定 html 元素,否则它将中断。
我一直在收到错误代码:1060.:
但是,我需要插入一些具有相同值的字段,但SQL拒绝并显示上述错误.错误可能是sql无法选择相同的列名,在这种情况下是否有其他编写代码的方法?以下是我目前的代码
INSERT INTO test.testTable SELECT *
FROM (SELECT NULL, 'hello', 'john', '2016-08-04 01:25:06', 'john'
, '2016-08-04 01:25:06', NULL, NULL) AS tmp
WHERE NOT EXISTS (SELECT * FROM test.testTable WHERE message= 'hello' AND created_by = 'john') LIMIT 1
Run Code Online (Sandbox Code Playgroud)
我的专栏:
请帮助,谢谢.