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 { NgModule } from '@angular/core'; | |
import { | |
MatButtonModule, | |
MatIconModule, | |
MatToolbarModule | |
} from '@angular/material'; | |
const modules = [ | |
MatButtonModule, |
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 { NgModule } from '@angular/core'; | |
import { BrowserModule } from '@angular/platform-browser'; | |
import { FormsModule } from '@angular/forms'; | |
import { AppComponent } from './app.component'; | |
import { ToolbarComponent } from './toolbar.component'; | |
import { MaterialModule } from './material.module'; | |
@NgModule({ |
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, Output, EventEmitter } from '@angular/core'; | |
import { FormGroup, FormControl } from '@angular/forms'; | |
@Component({ | |
selector: 'my-login-form', | |
template: ` | |
<mat-card> | |
<mat-card-title>Login</mat-card-title> | |
<mat-card-content> | |
<form [formGroup]="form" (ngSubmit)="submit()"> |
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'; | |
/** | |
* Turns the array into a sentence. | |
* | |
* @example | |
* {{ ['Stephen', 'Trevor' ] | AddCommas:'Customer' }} | |
*/ | |
@Pipe({ name: 'AddCommas' }) | |
export class AddCommasPipe implements PipeTransform { |
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
const postcss = require('postcss') | |
const fs = require('fs') | |
const options = { | |
html: ['html/*.html'] | |
} | |
fs.readFile('css/index.css','utf8', (err, css) => { | |
postcss([require('postcss-uncss')(options)]) | |
.process(css, { from: 'css/app.css', to: 'css/filtered.css' }) |
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
const autoprefixer = require('autoprefixer'); | |
var sugarss = require('sugarss'); | |
var postcss = require('postcss'); | |
var fs = require('fs'); | |
fs.readFile('red.sss', 'utf-8', (err, css)=>{ | |
postcss([autoprefixer]) | |
.process(css, { parser: sugarss, from: './red.sss', to: './app.css' }) | |
.then(result => { | |
fs.writeFile('./app.css', result.css, () => true) |
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
"use strict"; | |
const html = ()=>{ | |
return | |
`<!DOCTYPE html> | |
<html lang="en"> | |
`} | |
const css = ()=>{ | |
return `.red { color: red; }` | |
} |
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
<!DOCTYPE html> | |
<html lang="en"> | |
<head> | |
<meta charset="UTF-8"> | |
<meta name="viewport" content="width=device-width, initial-scale=1.0"> | |
<meta http-equiv="X-UA-Compatible" content="ie=edge"> | |
<title>Gherkin Component</title> | |
<link href="../css/index.css" rel="stylesheet"> | |
</head> |
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
let list = "none, inherit, circle, disc, decimal, lower-alpha, lower-latin, lower-greek, lower-roman, upper-alpha, upper-latin, upper-greek, upper-roman"; | |
let a = list.split(',').map(s=>s.trim()); | |
console.log(a); |
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
/** | |
* @param message The error message | |
* @param value The value that violates the constraint | |
* @param field The name of the field | |
* @param type The expected type for the field | |
* @param constraint The name of the constraint violated | |
* @param code The application or module code for the error | |
*/ | |
export class IsError extends Error { | |
constructor( |