Calling POST REST API in powershell with headers

In some cases we need to call POST REST API using Powershell.

Let’s go through sample code to get to know how it is done using Powershell.

In this Article we will go through below topics.

Create sample Web API
Invoke Web API in Powershell

read more Calling POST REST API in powershell with headers

Advertisements

Disabled directive in angular

Problem: When using reactive form in angular disabled property binding does not work in template. Solutions: Using disable method programmatically in form control. Create directive In my case I couldn’t use disabled since my input is not a control in form. It’s just a input in template. So I created directive. You can find it here. It might help some one having my requirement. Live demo import { Directive, ElementRef, Input } from ‘@angular/core’; import { OnChanges } from ‘@angular/core/src/metadata/lifecycle_hooks’; /** * Directive for add disable attribute to input element * Eg: [appInputDisabled]=”isDisabled” * @export * @class InputDisabledDirective * @implements {OnChanges} */ @Directive({ selector: ‘[appInputDisabled]’ }) export class InputDisabledDirective implements OnChanges { @Input() appInputDisabled: boolean; constructor(private el: ElementRef) { } ngOnChanges(): void { this.el.nativeElement.disabled = (this.appInputDisabled) ? true : false; } } Source code here …. Code on stackblitz