Skip to content

Commit

Permalink
feat(demo): use standalone components
Browse files Browse the repository at this point in the history
  • Loading branch information
bartholomej committed Dec 13, 2023
1 parent d38ed85 commit 7836e65
Show file tree
Hide file tree
Showing 8 changed files with 17 additions and 16 deletions.
6 changes: 2 additions & 4 deletions projects/demo/src/app/app-routing.module.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,13 +4,11 @@ import { RouterModule, Routes } from '@angular/router';
export const routes: Routes = [
{
path: '',
loadChildren: () =>
import('./component-way/component-way.module').then((m) => m.ComponentWayModule),
loadComponent: () => import('./component-way/component-way.component'),
},
{
path: 'directive-way',
loadChildren: () =>
import('./directive-way/directive-way.module').then((m) => m.DirectiveWayModule),
loadComponent: () => import('./directive-way/directive-way.component'),
},
];

Expand Down
3 changes: 1 addition & 2 deletions projects/demo/src/app/app.module.ts
Original file line number Diff line number Diff line change
@@ -1,12 +1,11 @@
import { NgModule } from '@angular/core';
import { BrowserModule } from '@angular/platform-browser';
import { NgxScrollTopModule } from '../../../ngx-scrolltop/src/lib/ngx-scrolltop.module';
import { AppRoutingModule } from './app-routing.module';
import { AppComponent } from './app.component';

@NgModule({
declarations: [AppComponent],
imports: [BrowserModule, AppRoutingModule, NgxScrollTopModule],
imports: [BrowserModule, AppRoutingModule],
providers: [],
bootstrap: [AppComponent],
})
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { NgModule } from '@angular/core';
import { RouterModule, Routes } from '@angular/router';
import { ComponentWayComponent } from './component-way.component';
import ComponentWayComponent from './component-way.component';

const routes: Routes = [{ path: '', component: ComponentWayComponent }];

Expand Down
Original file line number Diff line number Diff line change
@@ -1,8 +1,11 @@
import { Component } from '@angular/core';
import { NgxScrollTopComponent } from 'projects/ngx-scrolltop/src/public-api';

@Component({
selector: 'app-component-way',
templateUrl: './component-way.component.html',
styleUrls: ['./component-way.component.scss'],
standalone: true,
imports: [NgxScrollTopComponent],
})
export class ComponentWayComponent {}
export default class ComponentWayComponent {}
5 changes: 2 additions & 3 deletions projects/demo/src/app/component-way/component-way.module.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,9 @@ import { CommonModule } from '@angular/common';
import { NgModule } from '@angular/core';
import { NgxScrollTopModule } from '../../../../ngx-scrolltop/src/lib/ngx-scrolltop.module';
import { ComponentWayRoutingModule } from './component-way-routing.module';
import { ComponentWayComponent } from './component-way.component';
import ComponentWayComponent from './component-way.component';

@NgModule({
declarations: [ComponentWayComponent],
imports: [NgxScrollTopModule, CommonModule, ComponentWayRoutingModule],
imports: [NgxScrollTopModule, CommonModule, ComponentWayRoutingModule, ComponentWayComponent],
})
export class ComponentWayModule {}
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { NgModule } from '@angular/core';
import { RouterModule, Routes } from '@angular/router';
import { DirectiveWayComponent } from './directive-way.component';
import DirectiveWayComponent from './directive-way.component';

const routes: Routes = [{ path: '', component: DirectiveWayComponent }];

Expand Down
Original file line number Diff line number Diff line change
@@ -1,8 +1,11 @@
import { Component } from '@angular/core';
import { NgxScrollTopDirective } from 'projects/ngx-scrolltop/src/public-api';

@Component({
selector: 'app-directive-way',
templateUrl: './directive-way.component.html',
styleUrls: ['./directive-way.component.scss'],
standalone: true,
imports: [NgxScrollTopDirective],
})
export class DirectiveWayComponent {}
export default class DirectiveWayComponent {}
5 changes: 2 additions & 3 deletions projects/demo/src/app/directive-way/directive-way.module.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,9 @@ import { CommonModule } from '@angular/common';
import { NgModule } from '@angular/core';
import { NgxScrollTopModule } from '../../../../ngx-scrolltop/src/lib/ngx-scrolltop.module';
import { DirectiveWayRoutingModule } from './directive-way-routing.module';
import { DirectiveWayComponent } from './directive-way.component';
import DirectiveWayComponent from './directive-way.component';

@NgModule({
declarations: [DirectiveWayComponent],
imports: [CommonModule, DirectiveWayRoutingModule, NgxScrollTopModule],
imports: [CommonModule, DirectiveWayRoutingModule, NgxScrollTopModule, DirectiveWayComponent],
})
export class DirectiveWayModule {}

0 comments on commit 7836e65

Please sign in to comment.