This file contains 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
//create symbolic link for sublime | |
sudo ln -s /Applications/Sublime Text.app/Contents/SharedSupport/bin/subl /usr/local/bin/subl | |
//check your profile | |
sudo nano ~/.bash_profile | |
//your PATH contains all the directories that will be checked for executable binaries when you type a command into your terminal | |
// make sure /usr/local/bin in PATH, if not simply add to your PATH and save the file using the following command | |
export PATH=/usr/local/bin:$PATH |
This file contains 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: '[appDynamicComponentHost]' | |
}) | |
export class AppComponentHostDirective { | |
constructor(public viewContainerRef: ViewContainerRef) { } | |
} |
This file contains 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
<div class="app-ui-builder-content"> | |
<ng-template appDynamicComponentHost></ng-template> | |
</div> |
This file contains 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, Input, OnChanges, OnDestroy, OnInit, SimpleChanges, ViewChild } from '@angular/core'; | |
import { AddComponent } from '../add.component'; | |
import { AppComponentHostDirective } from '../app-component-host.directive'; | |
@Component({ | |
selector: 'app-ui-builder', | |
templateUrl: './app-ui-builder.component.html', | |
styleUrls: [] | |
}) | |
export class AppUIBuilderComponent implements OnInit, OnDestroy, OnChanges { |
This file contains 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
<div class="container mt-4"> | |
<ul> | |
<li><a routerLink="/project-overview" routerLinkActive="active">Project Overview</a></li> | |
<li><a routerLink="/project-detail">Project Detail</a></li> | |
</ul> | |
<router-outlet></router-outlet> | |
</div> |
This file contains 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 { NgModule } from '@angular/core'; | |
import { RouterModule, Routes } from '@angular/router'; | |
import { AppDynamicComponent } from './app-dynamic-component/app-dynamic.component'; | |
import { AppResolver } from './shared/app.resolver'; | |
const routes: Routes = [ | |
{ | |
path: 'project-overview', | |
component: AppDynamicComponent, | |
resolve: { |
This file contains 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
<app-ui-builder [components]="components"></app-ui-builder> |
This file contains 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 { HttpClient } from '@angular/common/http'; | |
import { | |
Resolve, | |
RouterStateSnapshot, | |
ActivatedRouteSnapshot | |
} from '@angular/router'; | |
import { map, Observable } from 'rxjs'; | |
import { PageBuilderService } from './page-builder.service'; |
This file contains 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 { Type } from '@angular/core'; | |
export class AddComponent { | |
constructor( | |
public component: Type<any>, | |
public config: any, | |
public data: string | |
) {} | |
} |
This file contains 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 { ActivatedRoute } from '@angular/router'; | |
import { AddComponent } from '../add.component'; | |
@Component({ | |
selector: 'app-dynamic-component', | |
templateUrl: './app-dynamic.component.html', | |
styleUrls: [] | |
}) | |
export class AppDynamicComponent implements OnInit { |
OlderNewer