Skip to content

Instantly share code, notes, and snippets.

@fireflysemantics
Created September 24, 2022 05:01
Show Gist options
  • Save fireflysemantics/0021b6267374bd8318254026b3bbdec5 to your computer and use it in GitHub Desktop.
Save fireflysemantics/0021b6267374bd8318254026b3bbdec5 to your computer and use it in GitHub Desktop.
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';
}
@Component({
selector: 'hello',
template: `<h1>Hello {{config.name}}!</h1>`,
styles: [`h1 { font-family: Lato; }`],
})
export class HelloComponent implements AfterViewInit {
@Input() config: Config;
ngAfterViewInit() {
console.log(this.config);
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment