更新时间:2023-10-17 19:07:16
我建议你检查UI路由器(因为ngRoute 会改变其他网页部分的状态页面 )由Waldek在下面建议。
https://blog.mastykarz .nl / build-multi-page-sharepoint-framework-client-side-web-parts-angular /
您可以从github下载示例演示。
https://github.com/SharePoint/ sp-dev-fx-webparts / tree / master / samples / angular-multipage
***的问候,
利跨度>
Hi All,
I have tried implementing routing concept in the client-side web part using SPFx and Angular 2. I have used 2 components for routing: listing component(routing path: "") and details component(routing path: "details/:id"). On load I am able to render all the items from the "Listing Component. On click of the title of a list item, i am trying to implement the routing concept. The URL of the sharepoint site gets changed to "site-url.aspx/details/1", if the id of the item is 1 and "details" is the routing path of the details component but the page is not getting rendered. I have tried the web part in workbench as well as
If anyone knows a solution to this problem, please help. Expecting a quick reply.
Regards, Shreyash
Hi,
I would suggest you check UI Router(as ngRoute would change the state in other web parts on the page ) suggested by Waldek below.
https://blog.mastykarz.nl/build-multi-page-sharepoint-framework-client-side-web-parts-angular/
You could download the sample demo from github.
https://github.com/SharePoint/sp-dev-fx-webparts/tree/master/samples/angular-multipage
Best Regards,
Lee