Skip to content

Instantly share code, notes, and snippets.

View fireflysemantics's full-sized avatar

Firefly Semantics Corporation fireflysemantics

View GitHub Profile
<hello
[config]="{
name: 'Firefly Semantics Slice',
language: 'typescript',
responsive: true
}"
></hello>
<hello
[config]="{ name: name, language: 'typescript', responsive: false }"
import { AfterViewInit, Component, Input } from '@angular/core';
export type Language = 'javascript' | 'typescript' | 'elixir';
export class Config {
name: string = 'RxJS';
responsive: boolean = true;
language: Language = 'typescript';
}
<!DOCTYPE html>
<html lang="en">
<head>
<title>Home</title>
<meta charset="UTF-8" />
<meta name="viewport" content="width=device-width" />
<!--
Need a visual blank slate?
Remove all code in `styles.css`!
-->
import { NgModule } from '@angular/core';
import { BrowserModule } from '@angular/platform-browser';
import { FormsModule } from '@angular/forms';
import { AppComponent } from './app.component';
import { HelloComponent } from './hello.component';
import { GreetingServiceModule } from './services/greeting-service.module';
import { AppRoutingModule } from './app-routing.module';
@NgModule({
import { ModuleWithProviders, NgModule } from '@angular/core';
import { GreetingService } from './greeting.service';
import { GreetingServiceConfig } from './greeting-service.config';
import { GREETING_SERVICE_CONFIG_INJECTION_TOKEN } from './greeting-service.token';
@NgModule({
providers: [GreetingService],
})
export class GreetingServiceModule {
import { Inject, Injectable } from '@angular/core';
import { GreetingServiceConfig } from './greeting-service.config';
import { GREETING_SERVICE_CONFIG_INJECTION_TOKEN } from './greeting-service.token';
@Injectable()
export class GreetingService {
constructor(
@Inject(GREETING_SERVICE_CONFIG_INJECTION_TOKEN)
private config: GreetingServiceConfig
@Directive({ selector: '[isReady]' })
export class ReadyDirective implements OnInit {
@Input('isReady') isReady: boolean;
constructor(
private templateRef: TemplateRef<void>,
private vcr: ViewContainerRef
) {}
ngOnInit() {
@Directive({ selector: '[isReady]' })
export class ReadyDirective implements OnInit {
@Input('isReady') isReady: boolean;
constructor(
private templateRef: TemplateRef<void>,
private vcr: ViewContainerRef
) {}
ngOnInit() {
color: (
primary: (
50: #e8eaf6,
100: #c5cae9,
200: #9fa8da,
300: #7986cb,
400: #5c6bc0,
500: #3f51b5,
600: #3949ab,
700: #303f9f,
nav {
display: flex;
align-items: center;
justify-content: center;
background-color: aqua;
width: 20rem;
height: 20rem;
}
.container {