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
randomHexColor:string = () => `#${(Math.random()*0xFFFFFF<<0).toString(16)}`; |
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
"C:\Program Files\nodejs\node.exe" "C:\Program Files\nodejs\node_modules\npm\bin\npm-cli.js" run start --scripts-prepend-node-path=auto | |
> [email protected] start C:\Users\KiraMed\Documents\COURSES\heedd-admin | |
> run-p pug-it:w server | |
> [email protected] pug-it:w C:\Users\KiraMed\Documents\COURSES\heedd-admin | |
> pug src -P -w | |
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
var createError = require('http-errors'); | |
var express = require('express'); | |
var path = require('path'); | |
var cookieParser = require('cookie-parser'); | |
var logger = require('morgan'); | |
var sassMiddleware = require('node-sass-middleware'); | |
var indexRouter = require('./routes/index'); | |
var usersRouter = require('./routes/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
{ | |
"extends": "../tsconfig.json", | |
"compilerOptions": { | |
"outDir": "../out-tsc/app", | |
"baseUrl": "./", | |
"module": "es2015", | |
"types": [ | |
"jquery", | |
"semantic-ui", | |
"underscore", |
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 { Injectable } from '@angular/core'; | |
import { AbstractControl } from '@angular/forms'; | |
// TODO: Check these: https://auth0.com/blog/angular2-series-forms-and-custom-validation/ | |
@Injectable() | |
export class ValidationService { | |
static getValidatorErrorMessage(validatorName: string, validatorValue?: any) { | |
let config = { | |
'required': 'Required', |
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 { Injectable } from '@angular/core'; | |
import { PRIMARY_OUTLET, Router, UrlSegment, UrlSegmentGroup, UrlTree } from '@angular/router'; | |
@Injectable() | |
export class RouteSegment { | |
constructor(private router: Router) { | |
} | |
path(position: number): string { |
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 { Directive, EventEmitter, HostListener, Input, OnDestroy, OnInit, Output } from '@angular/core'; | |
import { Subject } from 'rxjs/Subject'; | |
import { Subscription } from 'rxjs/Subscription'; | |
import { debounceTime } from 'rxjs/operators'; | |
@Directive({ | |
selector: '[kiraDebounceClick]' | |
}) | |
export class DebounceClickDirective implements OnInit, OnDestroy { | |
@Input() debounceTime = 500; |
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 { Pipe, PipeTransform } from '@angular/core'; | |
/* | |
* Capitalize the first letter of the string | |
* Takes a string as a value. | |
* Usage: | |
* value | capitalize | |
* Example: | |
* // value.name = daniel | |
* {{ value.name | capitalize }} |
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, EventEmitter, Input, OnInit, Output } from '@angular/core'; | |
import { SpinnerService } from './spinner.service'; | |
@Component({ | |
selector: 'spinner', | |
template: ` | |
<span *ngIf="show"> | |
<img *ngIf="loadingImage" [src]="loadingImage"/> | |
<ng-content></ng-content> | |
</span> |
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
<!-- pager --> | |
<div *ngIf="pager.pages && pager.pages.length" class="ui right floated pagination menu"> | |
<a [ngClass]="{disabled:pager.currentPage === 1}" (click)="setPage(1)" class="icon item"> | |
<i class="angle double left icon"></i> | |
</a> | |
<div *ngIf="pager.startPage > 1" class="disabled item">...</div> | |
<a [ngClass]="{disabled:pager.currentPage === 1}" (click)="setPage(pager.currentPage - 1)" class="icon item"> | |
<i class="angle left icon"></i> | |
</a> | |
<a *ngFor="let page of pager.pages" [ngClass]="{active:pager.currentPage === page}" (click)="setPage(page)" |