99import { Routes } from '@angular/router' ;
1010import { CanActivateComponentSidenav } from './pages/component-sidenav/component-sidenav-can-load-guard' ;
1111
12+ function externalRedirect ( target : string ) {
13+ return ( ) => {
14+ window . location . href = target ;
15+ return '' ; // unused due to redirect above
16+ } ;
17+ }
18+
1219export const MATERIAL_DOCS_ROUTES : Routes = [
1320 {
1421 path : '' ,
@@ -25,6 +32,31 @@ export const MATERIAL_DOCS_ROUTES: Routes = [
2532 // Since https://github.com/angular/components/pull/9574, the cdk-table guide became the overview
2633 // document for the cdk table. To avoid any dead / broken links, we redirect to the new location.
2734 { path : 'guide/cdk-table' , redirectTo : '/cdk/table/overview' } ,
35+ // Component harness, drag & drop docs have moved to angular.dev
36+ {
37+ path : 'cdk/testing' ,
38+ redirectTo : externalRedirect ( 'https://angular.dev/guide/testing/component-harnesses-overview' ) ,
39+ } ,
40+ {
41+ path : 'cdk/testing/api' ,
42+ redirectTo : externalRedirect ( 'https://angular.dev/api#angular_cdk_testing' ) ,
43+ } ,
44+ {
45+ path : 'cdk/testing/:tab' ,
46+ redirectTo : externalRedirect ( 'https://angular.dev/guide/testing/component-harnesses-overview' ) ,
47+ } ,
48+ {
49+ path : 'cdk/drag-drop' ,
50+ redirectTo : externalRedirect ( 'https://angular.dev/guide/drag-drop' ) ,
51+ } ,
52+ {
53+ path : 'cdk/drag-drop/api' ,
54+ redirectTo : externalRedirect ( 'https://angular.dev/api#angular_cdk_drag-drop' ) ,
55+ } ,
56+ {
57+ path : 'cdk/drag-drop/:tab' ,
58+ redirectTo : externalRedirect ( 'https://angular.dev/guide/drag-drop' ) ,
59+ } ,
2860 // In v19, the theming system became based on system variables and the mat.theme mixin.
2961 // The following guides were consolidated into the main theming guide, which redirects
3062 // users to v18 docs if they are looking for this content.
0 commit comments