This file contains hidden or 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
export const divide = (a: number, b: number): number => a / b | |
export const multiply = (a: number, b: number): number => a * b | |
export const power = (a: number, b: number): number => a ** b | |
export const sum = (a: number, b: number): number => a + b | |
export const subtract = (a: number, b: number): number => a - b |
This file contains hidden or 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
// THIS WORKS | |
@Validate() | |
async create(@Validator() profile: Profile): Promise<Profile> { | |
const profileInstance = plainToClass(Profile, {...profile, id: uuid()}); | |
const errors = await validate(profileInstance); | |
if (errors.length > 0) { | |
throw new BadRequestException(errors); | |
} | |
this.profiles.push(profileInstance); |
This file contains hidden or 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
{ | |
"$schema": "./node_modules/@angular/cli/lib/config/schema.json", | |
"version": 1, | |
"newProjectRoot": "projects", | |
"projects": { | |
"tutorial-angular-cli-v6-styling-bootstrap": { | |
"root": "", | |
"sourceRoot": "src", | |
"projectType": "application", | |
"prefix": "app", |
This file contains hidden or 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 * as express from 'express'; | |
import { join } from 'path'; | |
import { ngExpressEngine } from '@nguniversal/express-engine'; | |
import { provideModuleMap } from '@nguniversal/module-map-ngfactory-loader'; | |
const PORT = process.env.PORT || 8080; | |
const staticRoot = join(process.cwd(), 'dist', 'store'); | |
const {AppServerModuleNgFactory, LAZY_MODULE_MAP} = require('./dist/store-server/main'); |
This file contains hidden or 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 * as express from 'express'; | |
import { join } from 'path'; | |
import { ngExpressEngine } from '@nguniversal/express-engine'; | |
import { provideModuleMap } from '@nguniversal/module-map-ngfactory-loader'; | |
import * as compression from 'compression'; | |
import * as cache from 'memory-cache'; | |
const PORT = process.env.PORT || 8080; | |
const staticRoot = join(process.cwd(), 'dist', 'store'); |
This file contains hidden or 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 { Action, State } from '@ngxs/store'; | |
export type alertTypes = 'info' | 'success' | 'danger' | 'warning'; | |
export interface AlertPayload { | |
title: string; | |
type: alertTypes; | |
} | |
export class Alert { |
This file contains hidden or 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 { NgModule } from '@angular/core'; | |
import { AppComponent } from './app.component'; | |
@NgModule({ | |
declarations: [ | |
AppComponent | |
], |
This file contains hidden or 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
[ | |
{ | |
"name": "angular-seed", | |
"description": "Main Angular Seed with Bootstrap, FontAwesome and NGRX", | |
"url": "https://angular-seed.stackblitz.io", | |
"editUrl": "https://stackblitz.com/edit/angular-seed", | |
"forkUrl": "https://stackblitz.com/fork/angular-seed", | |
"features": [ | |
"Angular 5.2.1", | |
"@ngrx/store 4.1.1", |
This file contains hidden or 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
[ | |
{ | |
"shortcut_key_binding" : "alt+shift+cmd+z", | |
"shortcut_name" : "RedoLastMove" | |
}, | |
{ | |
"shortcut_key_binding" : null, | |
"shortcut_name" : "MakeSmaller" | |
}, | |
{ |
This file contains hidden or 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 { TestBed, async } from '@angular/core/testing'; | |
import { RouterTestingModule } from '@angular/router/testing'; | |
import { AppComponent } from './app.component'; | |
describe('AppComponent', () => { | |
beforeEach(async(() => { | |
TestBed.configureTestingModule({ | |
imports: [ | |
RouterTestingModule | |
], | |
declarations: [ |