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
import { ReactiveFormsModule } from '@angular/forms'; | |
@NgModule({ | |
declarations: [ | |
AppComponent | |
], | |
imports: [ | |
BrowserModule, | |
AppRoutingModule, ReactiveFormsModule, | |
ServiceWorkerModule.register('/ngsw-worker.js', { enabled: environment.production }) | |
], |
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
import { FormBuilder } from '@angular/forms'; | |
constructor(public fb: FormBuilder) { } |
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
curtomerForm: FormGroup; | |
constructor(public fb: FormBuilder) { } | |
ngOnInit() { | |
this.customerForm= this.fb.group({ | |
firstName: [''], | |
lastName: [''], | |
mobiles: this.fb.array([this.buildNumber()]) | |
}); |
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
<mat-card> | |
<mat-card-content> | |
<form class="example-form" [formGroup]="customerForm"> | |
<mat-form-field class="example-full-width"> | |
<input type="text" matInput formControlName="firstName" placeholder="FirstName"> | |
</mat-form-field> | |
<mat-form-field class="example-full-width"> | |
<input type="text" matInput formControlName="lastName" placeholder="Last Name"> | |
</mat-form-field> |
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
import { Injectable } from '@angular/core'; | |
import { Observable } from 'rxjs/Observable'; | |
import 'rxjs/add/observable/of'; | |
export interface ICustomer { | |
firstName: string; | |
lastName: string; | |
mobile: IMobile[]; | |
} | |
export interface IMobile { | |
number: string; |
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
this.data.getCustomer().subscribe(res => { | |
console.log(res[0]); | |
this.customerForm.patchValue({ | |
firstName: res[0].firstName, | |
lastName: res[0].lastName | |
}); | |
for (let index = 0; index < res[0].mobile.length; index++) { | |
this.mobiles.controls.push(this.buildNumber()); | |
this.mobiles.at(index).patchValue({ |
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
#Find character secuences including overlapping matches | |
s = "azcbobobegghakl" | |
p=[i for i in range(len(s)) if s.startswith('bob', i)] | |
print(p); | |
print(len(p)) | |
# Reading list | |
#Recommend Reading | |
# https://docs.python.org/3/tutorial/datastructures.html |
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
var auth0 = new auth0.WebAuth({ | |
clientID: environment.auth0.client_id, | |
domain: environment.auth0.domain, | |
responseType: environment.auth0.responseType, | |
audience: environment.auth0.audience, | |
redirectUri: environment.auth0.callbackurl, | |
scope: environment.auth0.scope, | |
}); | |
const params = { |
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
# Generate Token | |
# https://auth0.com/docs/api/authentication#client-credentials | |
curl --request POST \ | |
--url 'https://tanver.au.auth0.com/oauth/token' \ | |
-H 'content-type: application/json' \ | |
-d '{"grant_type":"client_credentials","client_id": "[client id]","client_secret": "[client secret]","audience": "https://[domain].auth0.com/api/v2/"}' | |
#Find Connection | |
# https://auth0.com/docs/api/management/v2#!/Connections/get_connections |
OlderNewer