Невозможно использовать файл шаблона в качестве шаблона для компонента в портлете Liferay angular. Тот же синтаксис отлично работает с простым приложением 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>
Ниже представлена моя среда деталь
- OS : windows
- Liferay : liferay-ce-portal-tomcat-7.3.2-ga3
- узел : v8.12.0
- angular / cli : ^ 1.6.7
- angular / compiler-cli : ^ 5.0.0
- liferay- npm -bundler : 2.18.2
- машинописный текст : 2.4.2
![Unable to use the template file as a template for the component in Liferay angular portlet](https://i.stack.imgur.com/ezd1j.png)