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 { ApplicationInsights } from "@microsoft/applicationinsights-web"; | |
import { | |
ActivatedRouteSnapshot, | |
ResolveEnd, | |
Router, | |
NavigationStart, | |
NavigationEnd, | |
RouterEvent | |
} from "@angular/router"; |
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
@ViewChild(DynamicDirective) dynamic: DynamicDirective; | |
constructor( | |
private componentFactoryService: ComponentFactoryService | |
) { | |
} | |
ngOnInit(){ | |
const dynamiCreateComponent = this.componentFactoryService.createComponent(TestComponent, this.dynamic); |
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 { | |
ComponentFactoryResolver, | |
Injectable, | |
ComponentRef | |
} from "@angular/core"; | |
@Injectable() | |
export class ComponentFactoryService { | |
private componentRef: ComponentRef<any>; | |
constructor(private componentFactoryResolver: ComponentFactoryResolver) {} | |
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
<ng-template dynamic-ref></ng-template> |
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 { Directive, ViewContainerRef } from "@angular/core"; | |
@Directive({ | |
selector: "[dynamic-ref]" | |
}) | |
export class DynamicDirective { | |
constructor(public viewContainerRef: ViewContainerRef) {} | |
} |
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
private readonly IOptions<EmailSettings> _emailSetting; | |
public EmailSender(IOptions<EmailSettings> emailSetting) | |
{ | |
_emailSetting = emailSetting; | |
} | |
email.From.Add(new MailboxAddress(_emailSetting.Value.SenderName, _emailSetting.Value.Sender)); |
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
services.Configure<EmailSettings>(configuration.GetSection("EmailSettings")); |
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 { BehaviorSubject } from 'rxjs/BehaviorSubject'; | |
@Injectable({ | |
providedIn: 'root', | |
}) | |
export class StorageService { | |
public static readonly TYPE_ACCESS_TOKEN: string = 'access_token'; |
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 { Component, OnInit } from '@angular/core'; | |
import { HttpClient } from '@angular/common/http'; | |
@Component({ | |
selector: 'app-home', | |
templateUrl: './home.component.html', | |
}) | |
export class HomeComponent implements OnInit { | |
constructor(private http: HttpClient) { |
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
query PostQuery { | |
posts (id:10){ | |
id | |
title | |
body | |
userId | |
comment { | |
id | |
body |