Skip to content

Instantly share code, notes, and snippets.

👋
_

Chris House crh225

👋
_
Block or report user

Report or block crh225

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 bg-color.pipe
import { Pipe, PipeTransform } from '@angular/core';
@Pipe({
name: 'bgColorPipe'
})
export class BgColorPipePipe implements PipeTransform {
transform(value: any, args?: any): any {
if(value === 'red'){
console.log('hit');
View component.html
<hello name="{{ name }}"></hello>
<p [ngStyle]="{'background-color': getColor()}">
Start editing to see some magic happen :)
</p>
<table>
<tr [ngStyle]="{'background-color': getColor()}">
<th [ngStyle]="{'background-color': getColor()}">Company</th>
<th [ngStyle]="{'background-color': getColor()}">Contact</th>
<th [ngStyle]="{'background-color': getColor()}">Country</th>
View component.html
<hello name="{{ name }}"></hello>
<p [ngStyle]="{'background-color': getColor()}">
Start editing to see some magic happen :)
</p>
View app.component.ts
form: FormGroup;
ngOnInit() {
this.form = new FormGroup({
'username': new FormControl('')
});
this.addValidator();
}
View barrel.tsx
import { IColumnVisibility, ILicense, ISoftware, ISyntax, ISyntax, ITag, Language } from "@interfaces";
View refactored-component.tsx
import { IColumnVisibility } from "@interfaces/IColumnVisibility";
import { ILicense } from "@interfaces/ILicense";
import { ISoftware } from "@interfaces/ISoftware";
import { ISyntax } from "@interfaces/ISyntax";
import { ITag } from "@interfaces/ITag";
import { Language } from "@interfaces/Language";
View tsconfig.json
// tsconfig.json
...
"compilerOptions": {
...
"baseUrl": "src",
"paths": {
"@interfaces": ["interfaces/*"]
}
...
}
View component.tsx
import { IColumnVisibility } from "../../../interfaces/IColumnVisibility";
import { ILicense } from "../../../interfaces/ILicense";
import { ISoftware } from "../../../interfaces/ISoftware";
import { ISyntax } from "../../../interfaces/ISyntax";
import { ITag } from "../../../interfaces/ITag";
import { Language } from "../../../interfaces/Language";
View search
@crh225
crh225 / example.scss
Created Mar 5, 2018
The SCSS way to inherit a css class
View example.scss
.something {
display: inline
}
.else {
background: red
}
.composite {
@extend .something;
@extend .else;
You can’t perform that action at this time.