skip to content
Alvin Lucillo

Use static files in Angular iframe

/ 1 min read

💻 Tech

Incoporating static files, like the those built from running yarn build or npm run build from apps like React, can be incorporated into an Angular app with its own route and component by specifying it in @Component template like so:

import { Component } from '@angular/core';

@Component({
  selector: 'app',
  template: '<iframe src="assets/component1" style="width:100%; height:100%; border:none;"></iframe>'
})
export class Component1 {}

The static files are located in assets/component.