-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
8 changed files
with
271 additions
and
244 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,95 +1,13 @@ | ||
import {NgForOf} from '@angular/common'; | ||
import { | ||
ChangeDetectionStrategy, | ||
ChangeDetectorRef, | ||
Component, | ||
inject, | ||
SecurityContext, | ||
TemplateRef, | ||
ViewEncapsulation, | ||
} from '@angular/core'; | ||
import {FormsModule, ReactiveFormsModule} from '@angular/forms'; | ||
import {TuiDay} from '@taiga-ui/cdk'; | ||
import { | ||
TuiButtonModule, | ||
TuiCalendarModule, | ||
TuiDialogService, | ||
TuiDropdownModule, | ||
TuiHintModule, | ||
TuiLinkModule, | ||
TuiRootModule, | ||
TuiSvgModule, | ||
TuiTextfieldControllerModule, | ||
} from '@taiga-ui/core'; | ||
import { | ||
TuiCheckboxLabeledModule, | ||
TuiInputDateModule, | ||
TuiInputTagModule, | ||
TuiPushModule, | ||
TuiSliderModule, | ||
TuiToggleModule, | ||
} from '@taiga-ui/kit'; | ||
import {NgDompurifyModule, NgDompurifySanitizer} from '@tinkoff/ng-dompurify'; | ||
import {ChangeDetectionStrategy, Component, ViewEncapsulation} from '@angular/core'; | ||
import {RouterOutlet} from '@angular/router'; | ||
import {TuiRootModule} from '@taiga-ui/core'; | ||
|
||
@Component({ | ||
standalone: true, | ||
selector: 'app', | ||
imports: [ | ||
TuiRootModule, | ||
NgForOf, | ||
ReactiveFormsModule, | ||
FormsModule, | ||
TuiInputTagModule, | ||
TuiToggleModule, | ||
TuiCalendarModule, | ||
TuiTextfieldControllerModule, | ||
TuiInputDateModule, | ||
TuiCheckboxLabeledModule, | ||
TuiButtonModule, | ||
TuiHintModule, | ||
TuiSliderModule, | ||
TuiSvgModule, | ||
TuiPushModule, | ||
TuiLinkModule, | ||
TuiDropdownModule, | ||
NgDompurifyModule, | ||
], | ||
imports: [TuiRootModule, RouterOutlet], | ||
templateUrl: './app.component.html', | ||
styleUrls: ['./app.component.less'], | ||
encapsulation: ViewEncapsulation.None, | ||
changeDetection: ChangeDetectionStrategy.OnPush, | ||
}) | ||
export class AppComponent { | ||
private readonly dompurifySanitizer = inject(NgDompurifySanitizer); | ||
private readonly dialogs = inject(TuiDialogService); | ||
private readonly cd = inject(ChangeDetectorRef); | ||
|
||
readonly labels = ['New', 'Read', 'Archived', 'Junk']; | ||
tags = ['Angular', 'Open source']; | ||
date: TuiDay | null = null; | ||
notification = false; | ||
slider = 80; | ||
|
||
onDay(date: TuiDay): void { | ||
this.date = date; | ||
} | ||
|
||
call(content: TemplateRef<HTMLElement>): void { | ||
this.dialogs | ||
.open(content, { | ||
appearance: 'call', | ||
closeable: false, | ||
dismissible: false, | ||
}) | ||
.subscribe(); | ||
} | ||
|
||
toggle(open: boolean): void { | ||
this.notification = open; | ||
this.cd.detectChanges(); | ||
} | ||
|
||
purify(value: string): string { | ||
return this.dompurifySanitizer.sanitize(SecurityContext.HTML, value); | ||
} | ||
} | ||
export class AppComponent {} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
import {Routes} from '@angular/router'; | ||
|
||
export const routes: Routes = [ | ||
{ | ||
path: ``, | ||
pathMatch: `full`, | ||
loadComponent: async (): Promise<any> => | ||
import(`./home/home.component`).then(module => module.HomeComponent), | ||
}, | ||
]; |
Oops, something went wrong.