This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import mongoose from "mongoose"; | |
export class AuthModel { | |
model: mongoose.Model<mongoose.Document, {}>; | |
constructor() { | |
this.define(); | |
} | |
private define() { | |
this.model = mongoose.model("User", new mongoose.Schema({ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Show hidden characters
{ | |
"exclude": ["node_modules"], | |
"compilerOptions": { | |
"rootDir": "src", | |
"outDir": "build", | |
"esModuleInterop": true, | |
"lib": [ | |
"dom", "es2015" | |
] | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import express from "express"; | |
import debug from "debug"; | |
const app: express.Application = express(); | |
const log = debug("logging"); | |
app.listen(4000, () => log("Express server running on 4000")); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import express from "express"; | |
import debug from "debug"; | |
const app: express.Application = express(); | |
const log = debug("logging"); | |
app.use(express.json()); | |
app.use(express.urlencoded({ | |
extended: false | |
})); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<div class="flexed" *ngIf="user$ | async as user"> | |
<div class="inner-flexed"> | |
<ul> | |
<li>Name: {{user.firstName}} {{user.lastName}}</li> | |
<li>Email: {{user.email}}</li> | |
<li>D.O.B: {{user.dob}}</li> | |
</ul> | |
</div> | |
</div> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<div *ngIf="users$ | async as users"> | |
<ul> | |
<li *ngFor="let user of users"> | |
<span>{{ user.firstName }}</span> | |
<span>{{ user.lastName }}</span> | |
</li> | |
</ul> | |
</div> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<table mat-table [dataSource]="users$" class="mat-elevation-z8"> | |
<ng-container matColumnDef="firstName"> | |
<th mat-header-cell *matHeaderCellDef>First Name</th> | |
<td mat-cell *matCellDef="let user">{{user.firstName}}</td> | |
</ng-container> | |
<ng-container matColumnDef="lastName"> | |
<th mat-header-cell *matHeaderCellDef>Last Name</th> | |
<td mat-cell *matCellDef="let user">{{user.lastName}}</td> | |
</ng-container> | |
<ng-container matColumnDef="email"> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import { Component, OnInit } from '@angular/core'; | |
import { Store, select } from '@ngrx/store'; | |
import { Router } from '@angular/router'; | |
import { selectUsers } from '../../management/selectors'; | |
import { AppState } from '../../management/states'; | |
import { LoadUsersActionPing } from '../../management/actions'; | |
import { User } from '../../models'; | |
@Component({ | |
selector: 'app-list-users', |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import { BrowserModule } from '@angular/platform-browser'; | |
import { BrowserAnimationsModule } from '@angular/platform-browser/animations'; | |
import { NgModule } from '@angular/core'; | |
import { StoreModule } from '@ngrx/store'; | |
import { StoreDevtoolsModule } from '@ngrx/store-devtools'; | |
import { EffectsModule } from '@ngrx/effects'; | |
import { AppComponent } from './app.component'; | |
import { MaterialModule, FormModule, RoutingModule } from '../modules'; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import { ActionReducerMap } from '@ngrx/store'; | |
import { AppState } from '../../states'; | |
import postReducer from '../post'; | |
import userReducer from '../user'; | |
const appReducers: ActionReducerMap<AppState> = { | |
userState: userReducer, | |
postState: postReducer | |
}; |