Skip to content

Instantly share code, notes, and snippets.

View chsami's full-sized avatar

chsami chsami

View GitHub Profile
"editor.fontLigatures": true,
"editor.fontFamily": "Fira Code",
shallowCopyExample() {
let product = {
name: 'beef',
price: 10,
category: {
name: 'food',
type: 'meat'
}
};
let shallowCopyOfProduct = product;
deepCopyExample() {
let product = {
name: 'beef',
price: 10,
category: {
name: 'food',
type: 'meat'
}
};
let deepCopyOfProduct = JSON.parse(JSON.stringify(product));
<head>
<link rel="stylesheet" type="text/css" href="mystyle.css">
</head>
<head>
<link rel="import" href="/path/to/some/import.html">
</head>
var marker = google.maps.Marker();
let cache$: Observable<any>;
cache$ = this.situationService.getSituations(this.id).shareReplay(1);
cache$.subscribe((situations: ISituation[]) => {
this.situations = situations;
});
cache$.subscribe((situations: ISituation[]) => {
@NgModule({
imports: [
MapModule.forRoot({
key: 'mykeyId'
})
],
})
export class MapModule {
static forRoot(mapConfig: IMapsConfig): ModuleWithProviders {
return {
ngModule: MapModule,
providers: [ {provide: MapsConfig, useValue: mapConfig} ]
}
}
}
export interface IMapsConfig {
key: string;
}