#Comprehensive Introduction to @ngrx/store By: @BTroncone
Written version of future egghead.io video series.
| // Imports | |
| import { NgModule } from '@angular/core'; | |
| import { BrowserModule } from '@angular/platform-browser'; | |
| import { SharedModule } from './shared/modules'; | |
| import { AppRoutingM } from './app-routing.m'; | |
| import { TranslateModule, TranslateLoader, TranslateStaticLoader } from 'ng2-translate'; | |
| // Declarations | |
| import { AppC } from './app.c'; | |
| import { errorD } from './routes/error/index'; |
| import { Injectable } from '@angular/core'; | |
| import { Router } from '@angular/router'; | |
| import { CanActivate, CanActivateChild, ActivatedRouteSnapshot } from '@angular/router'; | |
| import { AuthS } from '../../routes/auth/auth.s'; | |
| import { UserSt } from '../../routes/user/user.st'; | |
| import { isEmpty } from 'lodash'; | |
| @Injectable() | |
| export class LoggedInG implements CanActivate/*, CanActivateChild*/ { |
| <div class="form-group" [ngClass]="{'has-danger': feedback && !state.valid && !state.control.pristine }"> | |
| <label *ngIf="label" class="form-control-label">{{label}}</label> | |
| <ng-content></ng-content> | |
| <div *ngIf="feedback && !state.valid && !state.pristine"> | |
| <div *ngIf="state.hasError('required')" class="form-control-feedback">Required field.</div> | |
| <div *ngIf="state.hasError('minlength')" class="form-control-feedback">Has to be at least {{state.getError('minlength').requiredLength}} characters long.</div> | |
| <div *ngIf="state.hasError('maxlength')" class="form-control-feedback">Has to be less than {{state.getError('maxlength').requiredLength}} characters long.</div> | |
| <div *ngIf="state.hasError('incorrectFileExtension')" class="form-control-feedback">File extension has to be <code>{{state.getError('incorrectFileExtension').requiredFileExtension}}</code>.</div> |
| /* https://codepen.io/Craigtut/pen/dIfzv */ | |
| .ripple { | |
| overflow: hidden; | |
| } | |
| .ripple-effect { | |
| position: absolute; | |
| border-radius: 50%; | |
| width: 50px; | |
| height: 50px; |
| import { Component, Directive, TemplateRef, ViewContainerRef, Injector, | |
| ComponentFactoryResolver, Renderer } from '@angular/core'; | |
| @Component({ | |
| selector: 'alert', | |
| template: ` | |
| <div class="alert alert-success" role="alert"> | |
| <ng-content></ng-content> | |
| </div> | |
| ` |
| var Hapi = require('hapi'); | |
| const server = new Hapi.Server({ | |
| cache: [ | |
| { | |
| name: 'redisCache', | |
| engine: require('catbox-redis'), | |
| host: '127.0.0.1', | |
| partition: 'cache' | |
| } |
| function person(state, action) { | |
| state = state || {}; | |
| switch(action.type){ | |
| case 'ADD_INFO': | |
| return Object.assign({}, state, action.payload); | |
| default: | |
| return state; | |
| } | |
| } |
#Comprehensive Introduction to @ngrx/store By: @BTroncone
Written version of future egghead.io video series.
| // Place your settings in this file to overwrite default and user settings. | |
| { | |
| //-------- Search configuration -------- | |
| // Configure glob patterns for excluding files and folders in searches. Inherits all glob patterns from the file.exclude setting. | |
| "search.exclude": { | |
| "**/dist": true | |
| }, |
| types { | |
| # Data interchange | |
| application/atom+xml atom; | |
| application/json json map topojson; | |
| application/ld+json jsonld; | |
| application/rss+xml rss; | |
| application/vnd.geo+json geojson; | |
| application/xml rdf xml; |