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
const option = { | |
url: Routes.fetchLocalResponse(pageName), | |
// url: Routes.fetchServerResponse(pageName) | |
}; |
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
{ | |
"pageElements": [ | |
{ | |
"id": "projectDetailTitle", | |
"name": "projectDetailTitle", | |
"componentType": "label", | |
"visible": true, | |
"data": "Dynamic component loader", | |
"heading": true | |
}, |
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
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 { |
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 { 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
<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 { 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
<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 { 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 { |
NewerOlder