From b35da53cc869b56212a0e49949822a55d67d3d77 Mon Sep 17 00:00:00 2001 From: Jorge Rocha Gualtieri Date: Thu, 20 Feb 2020 16:57:43 -0300 Subject: [PATCH] Added @Injectable on states --- npm/ng-packs/packages/core/src/lib/core.module.ts | 2 +- npm/ng-packs/packages/core/src/lib/states/config.state.ts | 2 ++ npm/ng-packs/packages/core/src/lib/states/profile.state.ts | 2 ++ .../core/src/lib/states/replaceable-components.state.ts | 2 ++ npm/ng-packs/packages/core/src/lib/states/session.state.ts | 2 ++ 5 files changed, 9 insertions(+), 1 deletion(-) diff --git a/npm/ng-packs/packages/core/src/lib/core.module.ts b/npm/ng-packs/packages/core/src/lib/core.module.ts index 318c4adedc..019f4dd036 100644 --- a/npm/ng-packs/packages/core/src/lib/core.module.ts +++ b/npm/ng-packs/packages/core/src/lib/core.module.ts @@ -89,7 +89,7 @@ export function storageFactory(): OAuthStorage { StopPropagationDirective, LocalizationPipe, SortPipe, - LocalizationPipe, + LocalizationPipe ], providers: [LocalizationPipe], entryComponents: [ diff --git a/npm/ng-packs/packages/core/src/lib/states/config.state.ts b/npm/ng-packs/packages/core/src/lib/states/config.state.ts index ff964cfe92..081e7415fd 100644 --- a/npm/ng-packs/packages/core/src/lib/states/config.state.ts +++ b/npm/ng-packs/packages/core/src/lib/states/config.state.ts @@ -1,3 +1,4 @@ +import { Injectable } from '@angular/core'; import { Action, createSelector, Selector, State, StateContext, Store } from '@ngxs/store'; import { of } from 'rxjs'; import { switchMap, tap } from 'rxjs/operators'; @@ -19,6 +20,7 @@ import { SessionState } from './session.state'; name: 'ConfigState', defaults: {} as Config.State, }) +@Injectable() export class ConfigState { @Selector() static getAll(state: Config.State) { diff --git a/npm/ng-packs/packages/core/src/lib/states/profile.state.ts b/npm/ng-packs/packages/core/src/lib/states/profile.state.ts index 47e0506f2e..7cd06c8c83 100644 --- a/npm/ng-packs/packages/core/src/lib/states/profile.state.ts +++ b/npm/ng-packs/packages/core/src/lib/states/profile.state.ts @@ -1,3 +1,4 @@ +import { Injectable } from '@angular/core'; import { Action, Selector, State, StateContext } from '@ngxs/store'; import { tap } from 'rxjs/operators'; import { ChangePassword, GetProfile, UpdateProfile } from '../actions/profile.actions'; @@ -8,6 +9,7 @@ import { ProfileService } from '../services/profile.service'; name: 'ProfileState', defaults: {} as Profile.State, }) +@Injectable() export class ProfileState { @Selector() static getProfile({ profile }: Profile.State): Profile.Response { diff --git a/npm/ng-packs/packages/core/src/lib/states/replaceable-components.state.ts b/npm/ng-packs/packages/core/src/lib/states/replaceable-components.state.ts index 41c69df94f..7c07621ad4 100644 --- a/npm/ng-packs/packages/core/src/lib/states/replaceable-components.state.ts +++ b/npm/ng-packs/packages/core/src/lib/states/replaceable-components.state.ts @@ -1,3 +1,4 @@ +import { Injectable } from '@angular/core'; import { State, Action, StateContext, Selector, createSelector } from '@ngxs/store'; import { AddReplaceableComponent } from '../actions/replaceable-components.actions'; import { ReplaceableComponents } from '../models/replaceable-components'; @@ -7,6 +8,7 @@ import snq from 'snq'; name: 'ReplaceableComponentsState', defaults: { replaceableComponents: [] } as ReplaceableComponents.State, }) +@Injectable() export class ReplaceableComponentsState { @Selector() static getAll({ diff --git a/npm/ng-packs/packages/core/src/lib/states/session.state.ts b/npm/ng-packs/packages/core/src/lib/states/session.state.ts index 7ea742dce7..d319f62a18 100644 --- a/npm/ng-packs/packages/core/src/lib/states/session.state.ts +++ b/npm/ng-packs/packages/core/src/lib/states/session.state.ts @@ -1,3 +1,4 @@ +import { Injectable } from '@angular/core'; import { Action, Selector, @@ -25,6 +26,7 @@ import { OAuthService } from 'angular-oauth2-oidc'; name: 'SessionState', defaults: { sessionDetail: { openedTabCount: 0 } } as Session.State, }) +@Injectable() export class SessionState { @Selector() static getLanguage({ language }: Session.State): string {