Angular MdDialog-重用组件,而不是每次都创建
是否可以重新使用用于Angular MdDialog-重用组件,而不是每次都创建,angular,google-maps,angular-material2,mddialog,Angular,Google Maps,Angular Material2,Mddialog,是否可以重新使用用于MdDialog的组件实例 我这样使用它,它总是被重新创建: openLocationPicker() { const dialogParams: UserPickLocationDialogParams = { locationName: this.locationName, geoLocationString: this.latitudeLongitudeControl.nativeElement.value } let dialogRef =
MdDialog
的组件实例
我这样使用它,它总是被重新创建:
openLocationPicker() {
const dialogParams: UserPickLocationDialogParams = {
locationName: this.locationName,
geoLocationString: this.latitudeLongitudeControl.nativeElement.value
}
let dialogRef = this.dialog.open(UserPickLocationComponent, {
height: '470px',
width: '600px',
data: dialogParams
}).afterClosed().subscribe(returnVal => {
// ...
})
}
我想重新使用现有的实例,因为它拥有agm(谷歌地图),并且在每次打开对话框后,应用程序都会变得越来越慢(看起来像是资源泄漏)