Skip to content

Instantly share code, notes, and snippets.

thrixton

Block or report user

Report or block thrixton

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
View app.component.ts
// In app.component or relevant component requiring icon
import { faGoogle } from '@fortawesome/free-brands-svg-icons';
/*...*/
constructor(
_iconService: IconService
) {
_iconService.addSvg(faGoogle); // add icon to library
}
View icon.service.ts
import { Injectable } from '@angular/core';
import { MatIconRegistry } from '@angular/material';
import { DomSanitizer } from '@angular/platform-browser';
import { IconDefinition } from '@fortawesome/fontawesome-svg-core';
@Injectable({
providedIn: 'root'
})
export class IconService {
constructor(private _iconRegistry: MatIconRegistry, private _sanitizer: DomSanitizer) {}
@thrixton
thrixton / tslint.json
Last active Nov 15, 2018
Prettier tslint.json
View tslint.json
{
"rulesDirectory": ["node_modules/codelyzer"],
"rules": {
"arrow-return-shorthand": true,
"callable-types": true,
"class-name": true,
"deprecation": {
"severity": "warn"
},
"forin": true,
View tslint.json
{
"rules": {
"arrow-return-shorthand": true,
"callable-types": true,
"class-name": true,
"deprecation": {
"severity": "warn"
},
"forin": true,
"interface-over-type-literal": true,
View tslint.json
{
"rules": {
"arrow-return-shorthand": true,
"callable-types": true,
"class-name": true,
"deprecation": {
"severity": "warn"
},
"forin": true,
"interface-over-type-literal": true,
View .prettierrc
{
"printWidth": 120,
"singleQuote": true,
"useTabs": false,
"tabWidth": 2,
"semi": true,
"bracketSpacing": true
}
@thrixton
thrixton / key-value.pipe.ts
Created Dec 21, 2017 — forked from bombadillo/key-value.pipe.ts
Angular 2 Key Value Pipe
View key-value.pipe.ts
import { Pipe, PipeTransform } from '@angular/core';
/*
* Enables the key/value pair of an item to be
* visible within an ngFor
* Usage:
* value of iteratable | keyValue
* Example:
* <ul>
* <li *ngFor='key of demo | keyValue'>
View msal.service.ts
import { Injectable } from '@angular/core';
import { AppConfig } from '../app.config';
import {UserAgentApplication} from 'msal';
@Injectable()
export class MsalService {
accessToken: string;
userAgentApplication: UserAgentApplication = null;
constructor() {
this.userAgentApplication = new UserAgentApplication(
You can’t perform that action at this time.