Skip to content

Instantly share code, notes, and snippets.

View buildmotion's full-sized avatar

Matt Vaughn buildmotion

View GitHub Profile
@buildmotion
buildmotion / MarkdownEditorModule.js
Last active February 1, 2018 06:45
MarkdownEditorModule
import { NgModule } from '@angular/core';
import { CommonModule } from '@angular/common';
import { EditorComponent } from './editor/editor.component';
@NgModule({
imports: [
CommonModule
],
declarations: [EditorComponent],
exports: [
@buildmotion
buildmotion / IMarkdownEditorOptions.ts
Last active February 1, 2018 06:49
IMarkdownEditorOptions.ts
interface Options {
autoDownloadFontAwesome?: boolean;
autofocus?: boolean;
autosave?: AutoSaveOptions;
blockStyles?: BlockStyleOptions;
element?: HTMLElement;
forceSync?: boolean;
hideIcons?: string[];
indentWithTabs?: boolean;
initialValue?: string;
@buildmotion
buildmotion / MarkdownEditorOptions.ts
Created February 1, 2018 06:50
MarkdownEditorOptions.ts
import * as SimpleMDE from 'simplemde'; // MUST NPM INSTALL @types/[email protected]
export class MarkdownEditorOptions implements SimpleMDE.Options {
autoDownloadFontAwesome?: boolean;
autofocus?: boolean;
autosave?: SimpleMDE.AutoSaveOptions;
blockStyles?: SimpleMDE.BlockStyleOptions;
element?: HTMLElement;
forceSync?: boolean;
@buildmotion
buildmotion / MarkdownEditorModule.ts
Created February 1, 2018 06:52
MarkdownEditorModule.ts
import { NgModule } from '@angular/core';
import { CommonModule } from '@angular/common';
import { EditorComponent } from './editor/editor.component';
import { MarkdownEditorOptions } from './markdownEditorOptions';
@NgModule({
imports: [
CommonModule
],
@buildmotion
buildmotion / App.CoreModule.ts
Created February 1, 2018 06:54
App.CoreModule.ts
import {
ModuleWithProviders,
NgModule,
Optional,
SkipSelf
} from '@angular/core';
import { CommonModule } from '@angular/common';
import { MarkdownEditorModule } from './../markdown-editor/markdown-editor.module';
import { MarkdownEditorOptions } from './../markdown-editor/markdownEditorOptions';
@buildmotion
buildmotion / MarkdownEditorModule.EditorComponent.ts
Created February 1, 2018 06:59
MarkdownEditorModule.EditorComponent.ts
import {
Component,
ElementRef,
EventEmitter,
ViewChild,
AfterViewInit,
Input,
OnDestroy,
OnInit,
Output,
@buildmotion
buildmotion / App.PostComponent.ts
Created February 1, 2018 07:00
App.PostComponent.ts
import { Component, OnInit } from '@angular/core';
import { ComponentBase } from 'buildmotion-core';
import { Router } from '@angular/router';
import { LoggingService, Severity } from 'buildmotion-logging';
@Component({
selector: 'app-post',
templateUrl: './post.component.html',
styleUrls: ['./post.component.css']
})
@buildmotion
buildmotion / validate-credentials.action.ts
Last active February 14, 2018 17:47
ValidateCredentialsAction
import { Observable } from 'rxjs/Observable';
import { ErrorObservable } from 'rxjs/Observable/ErrorObservable';
import 'rxjs/add/observable/throw';
import { Response } from '@angular/http';
import * as rules from 'angular-rules-engine';
import { ActionResult } from 'angular-actions';
import { SecurityActionBase } from './security-action-base.action';
import { Severity } from 'nspire-logging/severity.enum';
import { Credentials } from './../../models/credentials.model';
import { Component, Input, OnInit } from '@angular/core';
import {NgbModal, NgbActiveModal} from '@ng-bootstrap/ng-bootstrap';
@Component({
selector: 'app-modal',
templateUrl: './modal.component.html',
styleUrls: ['./modal.component.css']
})
<div role="document" class="modal-dialog">
<div class="modal-content">
<div class="modal-header">
<h4 class="modal-title">{{title}}</h4>
<button type="button" class="close" aria-label="Close" (click)="activeModal.dismiss('Cross click')">
<span aria-hidden="true">&times;</span>
</button>
</div>
<div class="modal-body">
<ng-content></ng-content>