This file contains hidden or 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
| export class LoadAThing { | |
| private loadingTheThing = null | |
| constructor() {} | |
| /** | |
| * Triggers a call to retrieve something only once | |
| * Subsequent calls will be given the existing promise | |
| */ | |
| public loadThingAsync(): Promise<Environment> { | |
| // Only attempts the call if it is not currently loading |
This file contains hidden or 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
| public myForm: FormGroup | |
| constructor(private formBuilder: FormBuilder) { } | |
| ngOnInit() { | |
| this.myForm = this.formBuilder.group({ | |
| enabledControl: ['hello'], | |
| disabledControl: [{ | |
| value: 'world', | |
| disabled: true |
This file contains hidden or 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
| export interface MyFormValues { | |
| captcha: number; | |
| password: string; | |
| username: string; | |
| } | |
| export interface MyForm extends FormGroup { | |
| value: MyFormValues; | |
| controls: { | |
| captcha: AbstractControl; |
This file contains hidden or 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
| beforeEach(async(() => { | |
| TestBed.configureTestingModule({ | |
| imports: [MyComponentModule], | |
| providers: [ | |
| { provide: SomeSingletonService, useValue: new SomeSingletonServiceMock() } | |
| ] | |
| }) | |
| .overrideComponent(MyCompComponent, { | |
| set: { | |
| providers: [ |
This file contains hidden or 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
| /** | |
| ... | |
| * Plugin Name: AJ's Amazing Things Plugin | |
| * Plugin URI: mysite.com | |
| * Description: This plugin does amazing things! Visit the <a href="https://mysite.com/amazing-things/docs" target="_blank">documentation site</a> for usage instructions. | |
| ... | |
| */ |
This file contains hidden or 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
| <form [formGroup]="myForm"> | |
| <select formControlName="meal"> | |
| <option [value]="'dinoburger-special'">Dinoburger Special</option> | |
| <option [value]="'caveman-classic'">Caveman Classic</option> | |
| </select> | |
| <input type="number" formControlName="quantity"> | |
| <div formGroupName="extras"> | |
| Pickup: | |
| <input type="checkbox" formControlName="pickup"> | |
| <select multiple formControlName="sides"> |
OlderNewer