无法将模板文件用作 Liferay angular portlet 中组件的模板

Unable to use template file as a template for the component in Liferay angular portlet

无法将模板文件用作 Liferay angular portlet 中组件的模板。相同的语法在普通 angular 中工作正常申请。

app.component.ts

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

@Component({
    templateUrl: './app.component.html'
    /*
     * I've tried to pass template file path as below but it wasn't worked
     * templateUrl: './app.component.html'
     * templateUrl: './app.component'
     * templateUrl: 'app.component.html'
     * templateUrl: 'app.component'
     */
})

export class AppComponent {}

app.component.html

<h1>app component loaded using template file.</h1>

以下是我的环境详情

我从 Liferay 论坛找到了解决方案:https://liferay.dev/forums/-/message_boards/message/103176934#_com_liferay_message_boards_web_portlet_MBPortlet_message_106877078

根据描述,我更新了 templateUrl 路径如下,它工作正常。

app.component.ts

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

@Component({
    templateUrl: '/o/student-crud-portlet/lib/app/app.component.html'
})

export class AppComponent {}