Skip to content

Instantly share code, notes, and snippets.

View LayZeeDK's full-sized avatar
🇩🇰
Denmark

Lars Gyrup Brink Nielsen LayZeeDK

🇩🇰
Denmark
View GitHub Profile
@LayZeeDK
LayZeeDK / SassMeister-input.scss
Created April 19, 2015 17:13
Generated by SassMeister.com.
// ----
// Sass (v3.4.12)
// Compass (v1.0.3)
// ----
@function foo($keyword) {
@if $keyword == extra {
@return "true";
} @elseif $keyword == extra thin {
@return "true2";
@LayZeeDK
LayZeeDK / SassMeister-input.scss
Created April 19, 2015 17:17
Generated by SassMeister.com.
// ----
// Sass (v3.4.12)
// Compass (v1.0.3)
// ----
@mixin font-weight($keyword) {
$conversion-map: (
thin: 100,
hairline: 100,
extra light: 200,
@LayZeeDK
LayZeeDK / dashboard.component.ts
Last active September 16, 2019 04:58
Dashboard: Mixed component model
import { Component, OnInit } from '@angular/core';
import { Hero } from '../hero';
import { HeroService } from '../hero.service';
@Component({
selector: 'app-dashboard',
styleUrls: ['./dashboard.component.css'],
templateUrl: './dashboard.component.html',
})
@LayZeeDK
LayZeeDK / dashboard.component.html
Last active September 16, 2019 04:58
Dashboard: Mixed component template
<h3>Top Heroes</h3>
<div class="grid grid-pad">
<a *ngFor="let hero of heroes" class="col-1-4"
routerLink="/detail/{{hero.id}}">
<div class="module hero">
<h4>{{hero.name}}</h4>
</div>
</a>
</div>
@LayZeeDK
LayZeeDK / dashboard.container.ts
Last active October 10, 2018 08:41
Dashboard: Container component model
import { ChangeDetectionStrategy, Component } from '@angular/core';
import { Observable } from 'rxjs';
import { map } from 'rxjs/operators';
import { Hero } from '../hero';
import { HeroService } from '../hero.service';
@Component({
changeDetection: ChangeDetectionStrategy.OnPush,
selector: 'app-dashboard',
@LayZeeDK
LayZeeDK / dashboard.container.html
Last active July 15, 2018 21:41
Dashboard: Container component template
<app-dashboard-ui
[heroes]="topHeroes$ | async"
title="Top Heroes"></app-dashboard-ui>
@LayZeeDK
LayZeeDK / heroes.component.ts
Last active July 15, 2018 21:41
Heroes: Mixed component model
import { Component, OnInit } from '@angular/core';
import { Hero } from '../hero';
import { HeroService } from '../hero.service';
@Component({
selector: 'app-heroes',
styleUrls: ['./heroes.component.css'],
templateUrl: './heroes.component.html',
})
@LayZeeDK
LayZeeDK / heroes.component.html
Last active July 15, 2018 21:41
Heroes: Mixed component template
<h2>My Heroes</h2>
<div>
<label>Hero name:
<input #heroName />
</label>
<!-- (click) passes input value to add() and then clears the input -->
<button (click)="add(heroName.value); heroName.value=''">
add
</button>
@LayZeeDK
LayZeeDK / heroes.container.ts
Last active October 25, 2018 18:28
Heroes: Container component model
import { ChangeDetectionStrategy, Component } from '@angular/core';
import { noop, Observable, Subject } from 'rxjs';
import { multiScan } from 'rxjs-multi-scan';
import { Hero } from '../hero';
import { HeroService } from '../hero.service';
@Component({
changeDetection: ChangeDetectionStrategy.OnPush,
selector: 'app-heroes',
@LayZeeDK
LayZeeDK / heroes.container.html
Last active July 15, 2018 21:40
Heroes: Container component template
<app-heroes-ui
[heroes]="heroes$ | async"
title="My Heroes"
(add)="add($event)"
(remove)="delete($event)"></app-heroes-ui>