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
<div appDynamicScript> | |
<!-- most tags work, but Angular strips script tags, so don't try it. --> | |
<div | |
src="http://some.script.com/thing.js" | |
my-custom-attr="some value" | |
> | |
Some Text | |
</div> | |
</div> |
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 { AfterViewInit, Directive, ElementRef, Renderer2 } from '@angular/core'; | |
@Directive({ | |
selector: '[myStyleAnchors]' | |
}) | |
export class StyleAnchorsDirective implements AfterViewInit { | |
constructor(private el: ElementRef, private renderer: Renderer2) {} | |
ngAfterViewInit(): void { |
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
<div | |
[myStyleAnchors] | |
[innerHtml]="{{ someSafeHtml }}"> | |
</div> |
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
<html> | |
<!-- | |
Phone Tablet Desktop | |
Variable em px Query Port Land Port Land | |
------------------------------------------------------------------------------------------------------------------ | |
By default you should not write any media query at all. So, the first X X | X X | X | |
CSS definitions in your CSS file will apply to all devices unless you | | | |
have additional media queries defined afterward. | | | |
------------------------------------------------------------------------------------------------------------------ | |
$sm-min-width 35.5em 568px min-width: 35.5em X | X X | X |
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
// A list of well-known functions that the return value must be used. If unused | |
// then the function call is either a no-op (e.g. 'foo.trim()' foo is unchanged) | |
// or can be replaced by another (Array.map() should be replaced with a loop or | |
// Array.forEach() if the return value is unused). | |
const METHODS_TO_CHECK = new Set<string>([ | |
['Array', 'concat'], | |
['Array', 'filter'], | |
['Array', 'map'], | |
['Array', 'slice'], | |
['Function', 'bind'], |
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
"Log All The Things": { | |
"prefix": "ll", | |
"body": [ | |
"Logger.${LEVEL}('${CLASS}', '${METHOD}', `${message}`);" | |
] | |
} |
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
<div *ngIf="hasData(); else nodata"> | |
<div *ngFor="let item of data" | |
class="item" | |
(click)="delete(item)"> | |
{{ item }} | |
</div> | |
</div> | |
<ng-template #nodata> | |
No data |
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, OnInit } from '@angular/core'; | |
@Component({ | |
selector: 'nea-coverage-metrics-lie', | |
templateUrl: './coverage-metrics-lie.component.html', | |
styleUrls: ['./coverage-metrics-lie.component.scss'] | |
}) | |
export class CoverageMetricsLieComponent implements OnInit { | |
data: number[]; |
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 { async, ComponentFixture, TestBed } from '@angular/core/testing'; | |
import { CoverageMetricsLieComponent } from './coverage-metrics-lie.component'; | |
describe('CoverageMetricsLieComponent', () => { | |
let component: CoverageMetricsLieComponent; | |
let fixture: ComponentFixture<CoverageMetricsLieComponent>; | |
beforeEach(async(() => { | |
TestBed.configureTestingModule({ |
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
@Input() items: Array<T>; | |
@Output() click = new EventEmitter<T>(); |
NewerOlder