我希望能很好地解释自己。我有一个基于地图的应用程序。在此地图中,我们显示了许多标记,如果您单击它们,将在其中打开包含有关它们的信息的sidenav。我有这个路由:
Sub opentemplateWord()
Dim sh As Shape
Dim objWord As Object, objNewDoc As Object ''Word.Document
Dim objOLE As OLEObject
Dim wSystem As Worksheet
Dim cell As Range
Set wSystem = Worksheets("Templates")
''The shape holding the object from 'Create from file'
''Object 2 is the name of the shape
Set sh = wSystem.Shapes("WordFile")
''The OLE Object contained
Set objOLE = sh.OLEFormat.Object
'Instead of activating in-place, open in Word
objOLE.Verb xlOpen
Set objWord = objOLE.Object 'The Word document
Dim objUndo As Object 'Word.UndoRecord
'Be able to undo all editing performed by the macro in one step
Set objUndo = objWord.Application.UndoRecord
objUndo.StartCustomRecord "Edit In Word"
With objWord
.Bookmarks.Item("ProjectName1").Range.Text = ThisWorkbook.Sheets("MAIN").Range("D15").Value
.Bookmarks.Item("ProjectName2").Range.Text = ThisWorkbook.Sheets("MAIN").Range("D16").Value
objWord.SaveAs2 ActiveWorkbook.Path & "\" & Sheets("Other Data").Range("AN2").Value & _
", " & Sheets("Other Data").Range("AN7").Value & "_" & _
Sheets("Other Data").Range("AN8").Value & "_" & _
Sheets("Other Data").Range("AX2").Value & ".docx"
objUndo.EndCustomRecord
Set objUndo = Nothing
objWord.Undo
.Application.Quit False
End With
Set objWord = Nothing
End Sub
如果我想打开一个特定的sidenav,请使用:
{ path: 'map', loadChildren: './map/map.module#MapModule', canActivate: [AuthGuard] }
到目前为止,一切都很好。我的问题从这里开始:在应用程序中,我的表的路径不同:
{ path: 'map/:id_alteration', loadChildren: './map/map.module#MapModule', canActivate: [AuthGuard] },
此表具有指向每个标记的链接,我的意思是,表的每一行都具有指向{ path: 'table', loadChildren: './table-alterations/table-alterations.module#TableAlterationsModule', canActivate: [AuthGuard] },
的链接。这是什么问题?在侧边栏菜单中,我有两条可能的路线“表”和“地图”:
'pages / map /: id_alt'
如果我在<mat-nav-list>
<mat-accordion routerLink="/pages/map">
<mat-expansion-panel (opened)="panelOpenState = true" (closed)="panelOpenState = false" class="expansionAcordionSidebar">
<mat-expansion-panel-header [expandedHeight]="'40px'" [collapsedHeight]="'40px'">
<mat-panel-title>
<mat-icon>map</mat-icon>
Map
</mat-panel-title>
</mat-expansion-panel-header>
<a mat-list-item (click)="filterAlteration()" class="optionSidebarEsp">
<mat-icon>filter_list</mat-icon> <span class="optionSidebar-child">Filter</span>
</a>
<a mat-list-item *(click)="createAlteration()" routerLink="/pages/map" class="optionSidebarEsp">
<mat-icon>create</mat-icon><span class="optionSidebar-child">Create alteration</span>
</a>
</mat-expansion-panel>
</mat-accordion>
<a mat-list-item routerLink="/pages/table" class="optionSidebar">
<mat-icon>grid_on</mat-icon>Alterations Table
</a>
</mat-nav-list>
路线上,并且决定查看标记的信息,它将把我定向到路径'table'
。但是,如果我决定单击其中一个地图选项(例如,在'pages/map/id123'
{{1}下,例如创建更改),它将重定向我到路线并创建和销毁地图组件,从而丢失所有传输的信息从桌子上。
应用程序是否有任何方法可以识别它在子路径上,并且不会破坏该组件,而只是从初始路径中删除该ID?
谢谢!