Skip to content
This repository has been archived by the owner on Oct 7, 2020. It is now read-only.

Commit

Permalink
docs: Add missing @use imports to guides (#2079)
Browse files Browse the repository at this point in the history
closes #2076
  • Loading branch information
trimox authored Feb 13, 2020
1 parent 95ba220 commit 549c196
Show file tree
Hide file tree
Showing 24 changed files with 93 additions and 85 deletions.
6 changes: 3 additions & 3 deletions demos/src/app/app-routing.module.ts
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ const routes: Routes = [
import('./components/linear-progress/module').then(m => m.LinearProgressModule)
},
{path: 'list-demo', loadChildren: () => import('./components/list-demo/list.module').then(m => m.ListModule)},
{path: 'menu-demo', loadChildren: () => import('./components/menu-demo/menu.module').then(m => m.MenuModule)},
{path: 'menu-demo', loadChildren: () => import('./components/menu/module').then(m => m.MenuModule)},
{
path: 'menu-surface-demo', loadChildren: () =>
import('./components/menu-surface/module').then(m => m.MenuSurfaceModule)
Expand All @@ -73,11 +73,11 @@ const routes: Routes = [
{path: 'tabs-demo', loadChildren: () => import('./components/tabs-demo/tabs.module').then(m => m.TabsModule)},
{
path: 'text-field-demo', loadChildren: () =>
import('./components/text-field-demo/text-field.module').then(m => m.TextFieldModule)
import('./components/text-field/module').then(m => m.TextFieldModule)
},
{
path: 'top-app-bar-demo', loadChildren: () =>
import('./components/top-app-bar-demo/top-app-bar.module').then(m => m.TopAppBarModule)
import('./components/top-app-bar/module').then(m => m.TopAppBarModule)
},
{
path: 'typography-demo', loadChildren: () =>
Expand Down
13 changes: 0 additions & 13 deletions demos/src/app/components/menu-demo/menu.module.ts

This file was deleted.

29 changes: 0 additions & 29 deletions demos/src/app/components/menu-demo/routing.module.ts

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import {MdcListItem} from '@angular-mdc/web';
import {ComponentViewer} from '../../shared/component-viewer';

@Component({template: '<component-viewer></component-viewer>'})
export class MenuDemo implements OnInit {
export class Menu implements OnInit {
@ViewChild(ComponentViewer, {static: true}) _componentViewer: ComponentViewer;

ngOnInit(): void {
Expand All @@ -20,7 +20,9 @@ export class MenuDemo implements OnInit {
}],
code: `import {MdcMenuModule} from '@angular-mdc/web';`,
sass: `@use '@material/menu/mdc-menu';
@use '@material/menu';`
@use '@material/menu';
@use '@material/list/mdc-list';
@use '@material/menu-surface/mdc-menu-surface';`
};
}
}
Expand Down
13 changes: 13 additions & 0 deletions demos/src/app/components/menu/module.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
import {NgModule} from '@angular/core';

import {SharedModule} from '../../shared.module';
import {RoutingModule, ROUTE_DECLARATIONS} from './routing.module';

@NgModule({
imports: [
SharedModule,
RoutingModule
],
declarations: [ROUTE_DECLARATIONS]
})
export class MenuModule {}
Original file line number Diff line number Diff line change
@@ -1,18 +1,18 @@
import {NgModule} from '@angular/core';
import {Routes, RouterModule} from '@angular/router';

import {Api, Examples, Sass, TextFieldDemo} from './text-field-demo';
import {Api, Examples, Sass, Menu} from './menu';

export const ROUTE_DECLARATIONS = [
Api,
Examples,
Sass,
TextFieldDemo
Menu
];

const ROUTES: Routes = [
{
path: '', component: TextFieldDemo,
path: '', component: Menu,
children: [
{path: '', redirectTo: 'api'},
{path: 'api', component: Api},
Expand Down
3 changes: 2 additions & 1 deletion demos/src/app/components/radio/radio.ts
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,8 @@ export class Radio implements OnInit {
}],
code: `import {MdcRadioModule} from '@angular-mdc/web';`,
sass: `@use '@material/radio/mdc-radio';
@use '@material/radio';`
@use '@material/radio';
@use '@material/form-field/mdc-form-field';`
};
}
}
Expand Down
5 changes: 4 additions & 1 deletion demos/src/app/components/select/select.ts
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,10 @@ export class Select implements OnInit {
}],
code: `import {MdcSelectModule} from '@angular-mdc/web';`,
sass: `@use '@material/select/mdc-select';
@use '@material/select';`
@use '@material/select';
@use '@material/list/mdc-list';
@use '@material/menu-surface/mdc-menu-surface';
@use '@material/menu/mdc-menu';`
};
}
}
Expand Down
29 changes: 29 additions & 0 deletions demos/src/app/components/text-field/routing.module.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
import {NgModule} from '@angular/core';
import {Routes, RouterModule} from '@angular/router';

import {Api, Examples, Sass, TextField} from './text-field';

export const ROUTE_DECLARATIONS = [
Api,
Examples,
Sass,
TextField
];

const ROUTES: Routes = [
{
path: '', component: TextField,
children: [
{path: '', redirectTo: 'api'},
{path: 'api', component: Api},
{path: 'sass', component: Sass},
{path: 'examples', component: Examples}
]
}
];

@NgModule({
imports: [RouterModule.forChild(ROUTES)],
exports: [RouterModule]
})
export class RoutingModule {}
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ export class MyErrorStateMatcher implements ErrorStateMatcher {
}

@Component({template: '<component-viewer></component-viewer>'})
export class TextFieldDemo implements OnInit {
export class TextField implements OnInit {
@ViewChild(ComponentViewer, {static: true}) _componentViewer: ComponentViewer;

ngOnInit(): void {
Expand All @@ -31,7 +31,8 @@ export class TextFieldDemo implements OnInit {
}],
code: `import {MdcTextFieldModule} from '@angular-mdc/web';`,
sass: `@use '@material/textfield/mdc-text-field';
@use '@material/textfield';`
@use '@material/textfield';
@use '@material/form-field/mdc-form-field';`
};
}
}
Expand Down
29 changes: 0 additions & 29 deletions demos/src/app/components/top-app-bar-demo/routing.module.ts

This file was deleted.

29 changes: 29 additions & 0 deletions demos/src/app/components/top-app-bar/routing.module.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
import {NgModule} from '@angular/core';
import {Routes, RouterModule} from '@angular/router';

import {Api, Examples, Sass, TopAppBar} from './top-app-bar';

export const ROUTE_DECLARATIONS = [
Api,
Examples,
Sass,
TopAppBar
];

const ROUTES: Routes = [
{
path: '', component: TopAppBar,
children: [
{path: '', redirectTo: 'api'},
{path: 'api', component: Api},
{path: 'sass', component: Sass},
{path: 'examples', component: Examples}
]
}
];

@NgModule({
imports: [RouterModule.forChild(ROUTES)],
exports: [RouterModule]
})
export class RoutingModule {}
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import {Component, OnInit, ViewChild} from '@angular/core';
import {ComponentViewer} from '../../shared/component-viewer';

@Component({template: '<component-viewer></component-viewer>'})
export class TopAppBarDemo implements OnInit {
export class TopAppBar implements OnInit {
@ViewChild(ComponentViewer, {static: true}) _componentViewer: ComponentViewer;

ngOnInit(): void {
Expand All @@ -19,7 +19,8 @@ export class TopAppBarDemo implements OnInit {
}],
code: `import {MdcTopAppBarModule} from '@angular-mdc/web';`,
sass: `@use '@material/top-app-bar/mdc-top-app-bar';
@use '@material/top-app-bar';`
@use '@material/top-app-bar';
@use '@material/icon-button/mdc-icon-button';`
};
}
}
Expand Down

0 comments on commit 549c196

Please sign in to comment.