-2

is there an angular way to change the name of the file from which im displaying the content in the main tag? right now im just using the php include function:

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

but is there a "angulary" solution to change the hello.html file to be lets say...goodbye.html?

Al.s
  • 300
  • 4
  • 20

1 Answers1

1

Yes it is simple. but I don't understand your scenario and I'm not able to show you with PHP technology.

Use following way,

Index.html

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

    <div>
  </main>

Index.js

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
    }
});

any query feel free to ask questions... Hope I'd help...

micronyks
  • 54,797
  • 15
  • 112
  • 146