Warning: file_get_contents(/data/phpspider/zhask/data//catemap/1/php/228.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181

Warning: file_get_contents(/data/phpspider/zhask/data//catemap/3/html/85.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Php 使用angular在单击时更改包含的html文件_Php_Html_Angularjs - Fatal编程技术网

Php 使用angular在单击时更改包含的html文件

Php 使用angular在单击时更改包含的html文件,php,html,angularjs,Php,Html,Angularjs,是否有一个角度的方法来改变文件的名称,我从中显示的内容在主标签?现在我正在使用php include函数: <main> <?php include 'hello.html';?> </main> 但是,有没有一种“角度”解决方案可以将hello.html文件更改为lets say…再见.html?是的,它很简单。但我不理解您的场景,也无法向您展示PHP技术 用下面的方法, Index.html <main ng-init="loadPa

是否有一个角度的方法来改变文件的名称,我从中显示的内容在主标签?现在我正在使用php include函数:

<main>
   <?php include 'hello.html';?>
</main>


但是,有没有一种“角度”解决方案可以将hello.html文件更改为lets say…再见.html?

是的,它很简单。但我不理解您的场景,也无法向您展示PHP技术

用下面的方法,

Index.html

  <main ng-init="loadPage()">
    <div ng-include="{{url}}">

    <div>
  </main>
任何疑问都可以自由提问。。。 希望我能帮助…

这对你有帮助
appModuleName.Controller("index",function($scope){  //appModumodleName is the name of your angular app module

    $scope.loadPage=function()
    { 
      // User your logic to get your desired HTML page url.....

      $scope.url="hello.html"; //or path toward your hello.html
    }
});