mirror of
https://github.com/richard-loafle/fuse-angular.git
synced 2025-01-10 04:25:08 +00:00
(Fuse) Tree-shakable core services, closes #64
This commit is contained in:
parent
4e98ab1682
commit
09d1b1034e
|
@ -3,7 +3,9 @@ import { BehaviorSubject, Observable, Subject } from 'rxjs';
|
|||
|
||||
import { FuseNavigationItem } from '@fuse/types';
|
||||
|
||||
@Injectable()
|
||||
@Injectable({
|
||||
providedIn: 'root'
|
||||
})
|
||||
export class FuseNavigationService
|
||||
{
|
||||
onItemCollapsed: Subject<any>;
|
||||
|
|
|
@ -2,7 +2,9 @@ import { Injectable } from '@angular/core';
|
|||
|
||||
import { FuseSidebarComponent } from './sidebar.component';
|
||||
|
||||
@Injectable()
|
||||
@Injectable({
|
||||
providedIn: 'root'
|
||||
})
|
||||
export class FuseSidebarService
|
||||
{
|
||||
// Private
|
||||
|
|
|
@ -1,7 +1,9 @@
|
|||
import { Injectable } from '@angular/core';
|
||||
import { MatSidenav } from '@angular/material';
|
||||
|
||||
@Injectable()
|
||||
@Injectable({
|
||||
providedIn: 'root'
|
||||
})
|
||||
export class FuseMatSidenavHelperService
|
||||
{
|
||||
sidenavInstances: MatSidenav[];
|
||||
|
|
|
@ -1,29 +1,8 @@
|
|||
import { ModuleWithProviders, NgModule, Optional, SkipSelf } from '@angular/core';
|
||||
|
||||
import { FUSE_CONFIG, FuseConfigService } from '@fuse/services/config.service';
|
||||
import { FuseCopierService } from '@fuse/services/copier.service';
|
||||
import { FuseLoadingBarService } from '@fuse/services/loading-bar.service';
|
||||
import { FuseMatchMediaService } from '@fuse/services/match-media.service';
|
||||
import { FuseMatSidenavHelperService } from '@fuse/directives/fuse-mat-sidenav/fuse-mat-sidenav.service';
|
||||
import { FuseNavigationService } from '@fuse/components/navigation/navigation.service';
|
||||
import { FuseSidebarService } from '@fuse/components/sidebar/sidebar.service';
|
||||
import { FuseSplashScreenService } from '@fuse/services/splash-screen.service';
|
||||
import { FuseTranslationLoaderService } from '@fuse/services/translation-loader.service';
|
||||
import { FUSE_CONFIG } from '@fuse/services/config.service';
|
||||
|
||||
@NgModule({
|
||||
entryComponents: [],
|
||||
providers : [
|
||||
FuseConfigService,
|
||||
FuseCopierService,
|
||||
FuseLoadingBarService,
|
||||
FuseMatchMediaService,
|
||||
FuseMatSidenavHelperService,
|
||||
FuseNavigationService,
|
||||
FuseSidebarService,
|
||||
FuseSplashScreenService,
|
||||
FuseTranslationLoaderService
|
||||
]
|
||||
})
|
||||
@NgModule()
|
||||
export class FuseModule
|
||||
{
|
||||
constructor(@Optional() @SkipSelf() parentModule: FuseModule)
|
||||
|
|
|
@ -8,7 +8,9 @@ import * as _ from 'lodash';
|
|||
// Create the injection token for the custom settings
|
||||
export const FUSE_CONFIG = new InjectionToken('fuseCustomConfig');
|
||||
|
||||
@Injectable()
|
||||
@Injectable({
|
||||
providedIn: 'root'
|
||||
})
|
||||
export class FuseConfigService
|
||||
{
|
||||
// Private
|
||||
|
|
|
@ -1,14 +1,15 @@
|
|||
/**
|
||||
* This class is based on the code in the following projects:
|
||||
*
|
||||
* - https://github.com/zenorocha/select
|
||||
* - https://github.com/zenorocha/clipboard.js/
|
||||
* https://github.com/zenorocha/select
|
||||
* https://github.com/zenorocha/clipboard.js/
|
||||
*
|
||||
* Both released under MIT license - © Zeno Rocha
|
||||
*/
|
||||
import { Injectable } from '@angular/core';
|
||||
|
||||
@Injectable()
|
||||
@Injectable({
|
||||
providedIn: 'root'
|
||||
})
|
||||
export class FuseCopierService
|
||||
{
|
||||
private textarea: HTMLTextAreaElement;
|
||||
|
|
|
@ -3,7 +3,9 @@ import { NavigationEnd, NavigationStart, Router } from '@angular/router';
|
|||
import { BehaviorSubject, Observable } from 'rxjs';
|
||||
import { filter } from 'rxjs/operators';
|
||||
|
||||
@Injectable()
|
||||
@Injectable({
|
||||
providedIn: 'root'
|
||||
})
|
||||
export class FuseLoadingBarService
|
||||
{
|
||||
// Private
|
||||
|
|
|
@ -2,7 +2,9 @@ import { MediaChange, ObservableMedia } from '@angular/flex-layout';
|
|||
import { Injectable } from '@angular/core';
|
||||
import { BehaviorSubject } from 'rxjs';
|
||||
|
||||
@Injectable()
|
||||
@Injectable({
|
||||
providedIn: 'root'
|
||||
})
|
||||
export class FuseMatchMediaService
|
||||
{
|
||||
activeMediaQuery: string;
|
||||
|
|
|
@ -3,7 +3,9 @@ import { DOCUMENT } from '@angular/common';
|
|||
import { animate, AnimationBuilder, AnimationPlayer, style } from '@angular/animations';
|
||||
import { NavigationEnd, Router } from '@angular/router';
|
||||
|
||||
@Injectable()
|
||||
@Injectable({
|
||||
providedIn: 'root'
|
||||
})
|
||||
export class FuseSplashScreenService
|
||||
{
|
||||
splashScreenEl: any;
|
||||
|
|
|
@ -7,7 +7,9 @@ export interface Locale
|
|||
data: Object;
|
||||
}
|
||||
|
||||
@Injectable()
|
||||
@Injectable({
|
||||
providedIn: 'root'
|
||||
})
|
||||
export class FuseTranslationLoaderService
|
||||
{
|
||||
/**
|
||||
|
|
Loading…
Reference in New Issue
Block a user