| @@ -4,7 +4,8 @@ | ||
| </div> | ||
| <div class="app-content-container"> | ||
| <div class="app-content"> | ||
| <!-- <app-note-editor></app-note-editor> --> | ||
| <app-note-list></app-note-list> | ||
| </div> | ||
|
|
||
| <div class="sidebar-content"> | ||
| @@ -0,0 +1,11 @@ | ||
| import { Action } from '@ngrx/store'; | ||
|
|
||
| export const TOGGLE_EXPANDER = 'TOGGLE_EXPANDER' | ||
|
|
||
| export class ToggleExpanderAction implements Action { | ||
| readonly type = TOGGLE_EXPANDER; | ||
| constructor() { } | ||
| } | ||
|
|
||
| export type AppActions | ||
| = ToggleExpanderAction |
| @@ -0,0 +1,28 @@ | ||
| import Note from '../models/note'; | ||
| import * as appActions from './app.actions'; | ||
| import { ActionReducer, Action } from '@ngrx/store'; | ||
|
|
||
| export interface State { | ||
| Notes: Note[], | ||
| contentExpanded: boolean; | ||
| }; | ||
|
|
||
| export const initialState: State = { | ||
| Notes: [], | ||
| contentExpanded: false, | ||
| }; | ||
|
|
||
| export const reducer : ActionReducer<State> = (state : State = initialState, action: Action) => { | ||
| switch(action.type) { | ||
|
|
||
| case appActions.TOGGLE_EXPANDER: | ||
| console.log('toggled'); | ||
| return { | ||
| ... state, | ||
| contentExpanded: !state.contentExpanded | ||
| }; | ||
| default: | ||
| return state; | ||
| } | ||
| }; | ||
|
|
| @@ -43,7 +43,7 @@ | ||
|
|
||
| /** Evergreen browsers require these. **/ | ||
| // Used for reflect-metadata in JIT. If you use AOT (and only Angular decorators), you can remove. | ||
|
|
||
|
|
||
|
|
||
| /** | ||
| @@ -11,7 +11,8 @@ | ||
| ] | ||
| }, | ||
| "files": [ | ||
| "test.ts", | ||
| "polyfills.ts" | ||
| ], | ||
| "include": [ | ||
| "**/*.spec.ts", | ||
| @@ -14,6 +14,8 @@ | ||
| "lib": [ | ||
| "es2017", | ||
| "dom" | ||
| ], | ||
| "module": "es2015", | ||
| "baseUrl": "./" | ||
| } | ||
| } | ||
| @@ -18,7 +18,6 @@ | ||
| "forin": true, | ||
| "import-blacklist": [ | ||
| true, | ||
| "rxjs/Rx" | ||
| ], | ||
| "import-spacing": true, | ||