9
9
import { Routes } from '@angular/router' ;
10
10
import { CanActivateComponentSidenav } from './pages/component-sidenav/component-sidenav-can-load-guard' ;
11
11
12
+ function externalRedirect ( target : string ) {
13
+ return ( ) => {
14
+ window . location . href = target ;
15
+ return '' ; // unused due to redirect above
16
+ } ;
17
+ }
18
+
12
19
export const MATERIAL_DOCS_ROUTES : Routes = [
13
20
{
14
21
path : '' ,
@@ -25,6 +32,31 @@ export const MATERIAL_DOCS_ROUTES: Routes = [
25
32
// Since https://github.com/angular/components/pull/9574, the cdk-table guide became the overview
26
33
// document for the cdk table. To avoid any dead / broken links, we redirect to the new location.
27
34
{ 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
+ } ,
28
60
// In v19, the theming system became based on system variables and the mat.theme mixin.
29
61
// The following guides were consolidated into the main theming guide, which redirects
30
62
// users to v18 docs if they are looking for this content.
0 commit comments