(docs) Updated docs to use 'inject()' function in code examples

This commit is contained in:
Sercan Yemen 2024-05-26 12:27:43 +03:00
parent c842dadad9
commit 34138ad5fa
6 changed files with 27 additions and 37 deletions

View File

@ -1168,10 +1168,7 @@
<textarea fuse-highlight <textarea fuse-highlight
[lang]="'typescript'"> [lang]="'typescript'">
/** private _fuseAlertService = inject(FuseAlertService);
* Constructor
*/
constructor( private _fuseAlertService: FuseAlertService ) {}
/** /**
* Dismiss the alert via the service * Dismiss the alert via the service

View File

@ -125,17 +125,10 @@
<!-- @formatter:off --> <!-- @formatter:off -->
<textarea fuse-highlight <textarea fuse-highlight
lang="typescript"> lang="typescript">
import { FuseHighlightService } from '@fuse/components/highlight'; private _fuseHighlightService = inject(FuseHighlightService);
code = '<div> Some code to highlight </div>' code = '<div> Some code to highlight </div>'
highlightedCode = this._fuseHighlightService.highlight(code, 'html');
/**
* Constructor
*/
constructor(private _fuseHighlightService: FuseHighlightService)
{
const highlightedCode = this._fuseHighlightService.highlight(code, 'html');
}
</textarea> </textarea>
<!-- @formatter:on --> <!-- @formatter:on -->

View File

@ -205,10 +205,7 @@
<textarea <textarea
fuse-highlight fuse-highlight
[lang]="'ts'"> [lang]="'ts'">
/** private _fuseLoadingService = inject(FuseLoadingService);
* Constructor
*/
constructor( private _fuseLoadingService: FuseLoadingService ) { }
... ...
@ -310,16 +307,10 @@
<textarea <textarea
fuse-highlight fuse-highlight
[lang]="'ts'"> [lang]="'ts'">
apiCallStatus: string = '-'; private _httpClient = inject(HttpClient);
private _fuseLoadingService = inject(FuseLoadingService);
/** apiCallStatus: string = '-';
* Constructor
*/
constructor(
private _httpClient: HttpClient,
private _fuseLoadingService: FuseLoadingService
)
{ }
... ...
@ -439,12 +430,9 @@
<textarea <textarea
fuse-highlight fuse-highlight
[lang]="'ts'"> [lang]="'ts'">
mode: 'determinate' | 'indeterminate' = 'indeterminate'; private _fuseLoadingService = inject(FuseLoadingService);
/** mode: 'determinate' | 'indeterminate' = 'indeterminate';
* Constructor
*/
constructor( private _fuseLoadingService: FuseLoadingService ) { }
... ...

View File

@ -249,10 +249,12 @@
}) })
export class NavigationMockApi export class NavigationMockApi
{ {
private _fuseMockApiService = inject(FuseMockApiService);
/** /**
* Constructor * Constructor
*/ */
constructor(private _fuseMockApiService: FuseMockApiService) constructor()
{ {
// Register Mock API handlers // Register Mock API handlers
this.registerHandlers(); this.registerHandlers();
@ -301,13 +303,15 @@
}) })
export class NavigationMockApi export class NavigationMockApi
{ {
private _fuseMockApiService = inject(FuseMockApiService);
private readonly _compactNavigation: any[]; private readonly _compactNavigation: any[];
private readonly _defaultNavigation: any[]; private readonly _defaultNavigation: any[];
/** /**
* Constructor * Constructor
*/ */
constructor(private _fuseMockApiService: FuseMockApiService) constructor()
{ {
// Set the data // Set the data
this._compactNavigation = compactNavigation; this._compactNavigation = compactNavigation;

View File

@ -111,10 +111,12 @@
<textarea fuse-highlight lang="typescript"> <textarea fuse-highlight lang="typescript">
import { FuseConfigService } from '@fuse/services/config'; import { FuseConfigService } from '@fuse/services/config';
private _fuseConfigService = inject(FuseConfigService);
/** /**
* Constructor * Constructor
*/ */
constructor(private _fuseConfigService: FuseConfigService) constructor()
{ {
this._fuseConfigService.config = {layout: 'classy'}; this._fuseConfigService.config = {layout: 'classy'};
} }
@ -128,12 +130,14 @@
import { FuseConfigService } from '@fuse/services/config'; import { FuseConfigService } from '@fuse/services/config';
import { AppConfig } from 'app/core/config/app.config'; import { AppConfig } from 'app/core/config/app.config';
private _fuseConfigService = inject(FuseConfigService);
config: AppConfig; config: AppConfig;
/** /**
* Constructor * Constructor
*/ */
constructor(private _fuseConfigService: FuseConfigService) constructor()
{ {
this._fuseConfigService.config$ this._fuseConfigService.config$
.pipe(takeUntil(this._unsubscribeAll)) .pipe(takeUntil(this._unsubscribeAll))

View File

@ -58,10 +58,12 @@
<textarea fuse-highlight lang="typescript"> <textarea fuse-highlight lang="typescript">
import { FuseMediaWatcherService } from '@fuse/services/config'; import { FuseMediaWatcherService } from '@fuse/services/config';
private _fuseMediaWatcherService = inject(FuseMediaWatcherService);
/** /**
* Constructor * Constructor
*/ */
constructor(private _fuseMediaWatcherService: FuseMediaWatcherService) constructor()
{ {
// Subscribe to media changes // Subscribe to media changes
this._fuseMediaWatcherService.onMediaChange$ this._fuseMediaWatcherService.onMediaChange$
@ -81,10 +83,12 @@
<textarea fuse-highlight lang="typescript"> <textarea fuse-highlight lang="typescript">
import { FuseMediaWatcherService } from '@fuse/services/config'; import { FuseMediaWatcherService } from '@fuse/services/config';
private _fuseMediaWatcherService = inject(FuseMediaWatcherService);
/** /**
* Constructor * Constructor
*/ */
constructor(private _fuseMediaWatcherService: FuseMediaWatcherService) constructor()
{ {
// Subscribe to media changes // Subscribe to media changes
this._fuseMediaWatcherService.onMediaQueryChange$('(min-width: 1440px)') this._fuseMediaWatcherService.onMediaQueryChange$('(min-width: 1440px)')