Angular 2 CLI - 用于索引文件的 php 而不是 html 文件 [英] Angular 2 CLI - php for index file instead of html file

查看:31
本文介绍了Angular 2 CLI - 用于索引文件的 php 而不是 html 文件的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

有没有办法将通过 Angular 2 CLI 创建和提供的 Angular 2 应用程序从默认的 html 文件更改为 php 文件?有没有设置某个地方用 ng serve 命令确定作为默认索引文件?

Is there a way to change an Angular 2 application that is created and served via Angular 2 CLI from the default html file to a php file? Is there a setting someplace that determines with the ng serve command serves up as the default index file?

MBU

推荐答案

似乎 angular cli 不允许您将默认文件名设置为与 index.html 不同的名称.

It seems that angular cli does not allow you to set default file name to something different than index.html.

即使可以更改 index.php,您也不会完成您想要的.要运行 php 文件,您需要 PHP 解释器.ng serve 中没有这样的东西,因为它的主要目的是提供静态 HTML 文件.

Even if the change to index.php would be possible, you will not accomplish what you want. To run php files, you need PHP interpreter. There is no such thing in ng serve, as it's main purpose is to serve static HTML files.

这篇关于Angular 2 CLI - 用于索引文件的 php 而不是 html 文件的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆