Skip to content

Commit d81b7f6

Browse files
committed
feat(demo): use standalone components
1 parent 4ce92fe commit d81b7f6

File tree

4 files changed

+11
-8
lines changed

4 files changed

+11
-8
lines changed

projects/demo/src/app/app-routing.module.ts

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -4,13 +4,11 @@ import { RouterModule, Routes } from '@angular/router';
44
export const routes: Routes = [
55
{
66
path: '',
7-
loadChildren: () =>
8-
import('./component-way/component-way.module').then((m) => m.ComponentWayModule),
7+
loadComponent: () => import('./component-way/component-way.component'),
98
},
109
{
1110
path: 'directive-way',
12-
loadChildren: () =>
13-
import('./directive-way/directive-way.module').then((m) => m.DirectiveWayModule),
11+
loadComponent: () => import('./directive-way/directive-way.component'),
1412
},
1513
];
1614

projects/demo/src/app/app.module.ts

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,11 @@
11
import { NgModule } from '@angular/core';
22
import { BrowserModule } from '@angular/platform-browser';
3-
import { NgxScrollTopModule } from '../../../ngx-scrolltop/src/lib/ngx-scrolltop.module';
43
import { AppRoutingModule } from './app-routing.module';
54
import { AppComponent } from './app.component';
65

76
@NgModule({
87
declarations: [AppComponent],
9-
imports: [BrowserModule, AppRoutingModule, NgxScrollTopModule],
8+
imports: [BrowserModule, AppRoutingModule],
109
providers: [],
1110
bootstrap: [AppComponent],
1211
})
Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,11 @@
11
import { Component } from '@angular/core';
2+
import { NgxScrollTopComponent } from 'projects/ngx-scrolltop/src/public-api';
23

34
@Component({
45
selector: 'app-component-way',
56
templateUrl: './component-way.component.html',
67
styleUrls: ['./component-way.component.scss'],
8+
standalone: true,
9+
imports: [NgxScrollTopComponent],
710
})
8-
export class ComponentWayComponent {}
11+
export default class ComponentWayComponent {}
Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,11 @@
11
import { Component } from '@angular/core';
2+
import { NgxScrollTopDirective } from 'projects/ngx-scrolltop/src/public-api';
23

34
@Component({
45
selector: 'app-directive-way',
56
templateUrl: './directive-way.component.html',
67
styleUrls: ['./directive-way.component.scss'],
8+
standalone: true,
9+
imports: [NgxScrollTopDirective],
710
})
8-
export class DirectiveWayComponent {}
11+
export default class DirectiveWayComponent {}

0 commit comments

Comments
 (0)