Skip to content

Instantly share code, notes, and snippets.

View beeman's full-sized avatar
🐝
Buzzin....

beeman beeman

🐝
Buzzin....
View GitHub Profile
// 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);
@beeman
beeman / angular.json
Created May 21, 2018 17:12
example of multiple styles
{
"$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",
@beeman
beeman / server.ts
Created May 20, 2018 07:11
Express server for Angular Universal with an Angular CLI v6 app
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');
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');
import { Action, State } from '@ngxs/store';
export type alertTypes = 'info' | 'success' | 'danger' | 'warning';
export interface AlertPayload {
title: string;
type: alertTypes;
}
export class Alert {
import { BrowserModule } from '@angular/platform-browser';
import { NgModule } from '@angular/core';
import { AppComponent } from './app.component';
@NgModule({
declarations: [
AppComponent
],
[
{
"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",
@beeman
beeman / Shortcuts.json
Created February 3, 2018 22:00
~/Library/Application\ Support/Spectacle/Shortcuts.json
[
{
"shortcut_key_binding" : "alt+shift+cmd+z",
"shortcut_name" : "RedoLastMove"
},
{
"shortcut_key_binding" : null,
"shortcut_name" : "MakeSmaller"
},
{
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: [
________
╱ ╲
╱ ╲
________╱ ╲
╱ ╲ ╱
╱ ╲ ╱
╱ ╲________╱
╲ ╱ ╲
╲ ╱ ╲
╲________╱ ╲