/* * @Author: ferried * @Email: harlancui@outlook.com * @Date: 2021-02-04 15:23:37 * @LastEditTime: 2021-03-05 11:11:19 * @LastEditors: ferried * @Description: Basic description * @FilePath: /stars/projects/stars/src/schematics/ng-add/files/src/app/index/index.component.ts * @LICENSE: NONE */ import {Component, ElementRef, OnInit, ViewChild} from "@angular/core"; import {ConfigService, globalStar, StarComponentLoader, StarComponentRef} from "@yunzai/stars"; @Component({ selector: "<%=prefix%>-index", templateUrl: "./index.component.html", styleUrls: ["./index.component.less"], }) export class IndexComponent implements OnInit { @ViewChild('container', {static: true}) containerElementRef: ElementRef; private componentRef: StarComponentRef; constructor(private starComponentLoader: StarComponentLoader) { } ngOnInit() { setTimeout(() => { this.starComponentLoader.load('star-uranus', 'share', { container: this.containerElementRef, initialState: {} }).subscribe((r) => { this.componentRef = r }) }, 5000) } jump(route: string): void { globalStar.portalApplication.navigateByUrl(route); } }