Skip to content

Commit 3848baa

Browse files
authored
refactor: use standalone component for demo (#231)
Reduces the amount of boilerplate by using a standalone component in the demo.
1 parent 8bba728 commit 3848baa

File tree

3 files changed

+8
-18
lines changed

3 files changed

+8
-18
lines changed

src/demo/app/demo.component.ts

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,14 @@
11
import {Component} from '@angular/core';
2+
import {CommonModule} from '@angular/common';
3+
import {FormsModule} from '@angular/forms';
4+
import {RoundProgressModule} from 'angular-svg-round-progressbar';
25

36
@Component({
47
selector: 'demo',
58
templateUrl: './demo.component.html',
69
styleUrls: ['./demo.component.css'],
10+
standalone: true,
11+
imports: [RoundProgressModule, CommonModule, FormsModule]
712
})
813
export class DemoComponent {
914
current = 27;

src/demo/app/demo.module.ts

Lines changed: 0 additions & 12 deletions
This file was deleted.

src/demo/main.ts

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,10 @@
11
import {enableProdMode} from '@angular/core';
2-
import {platformBrowserDynamic} from '@angular/platform-browser-dynamic';
3-
4-
import {DemoModule} from './app/demo.module';
2+
import {bootstrapApplication} from '@angular/platform-browser';
3+
import {DemoComponent} from './app/demo.component';
54
import {environment} from './environments/environment';
65

76
if (environment.production) {
87
enableProdMode();
98
}
109

11-
platformBrowserDynamic()
12-
.bootstrapModule(DemoModule)
13-
.catch(error => console.error(error));
10+
bootstrapApplication(DemoComponent).catch(error => console.error(error));

0 commit comments

Comments
 (0)