使用前端+后端框架时保持模板文件的组织性
Keep template files organised when using a front-end + backend framework
我正在为应用程序使用 Angular 和 Mojolicious (Perl),想知道是否有办法将我所有的 html 和 TT(Perl 的模板引擎)模板保留在外部public 目录?目前,我将我的 html 模板放在 public 目录下,而我的 TT 模板位于其他地方。
理想情况下,我希望我的 html 模板与我的 TT 模板位于同一文件夹下,但是在使用 Angular 指令时,我的 JS 文件无法访问它们。
我做到了using Mojolicious::Static:
push @{$static->paths}, '/directory/path';
我正在为应用程序使用 Angular 和 Mojolicious (Perl),想知道是否有办法将我所有的 html 和 TT(Perl 的模板引擎)模板保留在外部public 目录?目前,我将我的 html 模板放在 public 目录下,而我的 TT 模板位于其他地方。
理想情况下,我希望我的 html 模板与我的 TT 模板位于同一文件夹下,但是在使用 Angular 指令时,我的 JS 文件无法访问它们。
我做到了using Mojolicious::Static:
push @{$static->paths}, '/directory/path';