Skip to content

Instantly share code, notes, and snippets.


Block or report user

Report or block goughjo02

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 app-parent.js
// app-parent.ts
selector: 'example-parent',
template: `./example-parent.html`,
styleUrls: ['./parent.component.css']
export class ParentComponent implements OnInit {
formBroadcast: Subject<FormGroup> = new BehaviorSubject(null);
View app-parent.html
<!-- app-parent.html -->
<app-form-component [(form)]="form" />
View child-form.component.html
<!-- child-form-component.html -->
<form [formGroup]="form">
First Name:
<input type="text" formControlName="name" />
Last Name:
<input type="number" formControlName="age" />
View child-form.component.ts
// child-form-component.ts
selector: "child-form-component",
templateUrl: "./child-form.component.html"
export class ChildFormComponent implements OnInit {
_formValue: FormGroup;
get form() {
return this._formValue;
View two-way-data-binding-angular.ts
selector: "example-component",
templateUrl: "./example.html"
export class ExampleComponent implements OnInit {
_objectValue: any;
get object() {
return this._objectValue;
View dynamic-import-react-example-1.js
import React from "react";
export default class LazilyLoadedCustomFeature extends Component {
state = {
content: null
componentDidMount() {
import(pathtofile).then(e => {
this.setState({ content: e });
View dynamic-import-example-1.js
import(pathtofile).then(e => {
console.log("module loaded!");
View observable-subscription-example-1.ts
import { SelectionModel } from "@angular/cdk/collections";
export class AppComponent implements OnInit {
constructor(peopleSelection: PeopleSelectionService) {}
ngOnInit(): void {
this.peopleSelection.selection.changed.subscribe(e => {
console.log(`I have received a value ${e}`);
View provide-in-root.ts
providedIn: "root"
export class SingletonRootService {}
You can’t perform that action at this time.