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