title: How get text with HTML tags from server and display it in client side with HTML markup? (using php and angularjs)
body: <p>I'm trying to learn web development by creating an app.
  I'm using Angularjs in client side and php on server side.
  I need to load content of articles from server when a user select an article.
  I want do the html markup in the server side and then get the text in client side and display it. (i.e. I want to do save text as "&lt; h1>Heading&lt; /h1> &lt; p>paragraph&lt; /p>" and then transfer the text to client and display it in client.</p>
  
  <p>I tried echoing the text in a php file with markup tags and then get the text through $http service in angularjs. But the browser does not seem to identify the markup tags but display the html tags with the text. </p>
  
  <p>How can I achieve this? </p>
  
  <p>notes2.php</p>
  
  <pre><code> &lt;?php
      $variable = &lt;&lt;&lt;XYZ
                  &lt;html&gt;
                  &lt;body&gt;
                      &lt;h1&gt;Heading&lt;/h1&gt;
                      &lt;p&gt; paragraph &lt;/p&gt;
                  &lt;/body&gt;
                  &lt;/html&gt;
  XYZ;
  
      echo $variable;
   ?&gt;
  </code></pre>
  
  <p>getnotes.html</p>
  
  <pre><code>&lt;!DOCTYPE html&gt;
  &lt;html&gt;
  &lt;script src="js/angular.min.js"&gt;&lt;/script&gt;
  &lt;script src="js/angular-route.js"&gt;&lt;/script&gt;
  
  &lt;body ng-app="myApp" ng-controller="myCtrl"&gt;
  &lt;p id="demo"&gt;&lt;/p&gt;
  
  &lt;script&gt;
  var app = angular.module("myApp", ["ngRoute"]);
  
  app.controller('myCtrl', ['$scope', '$http', function($scope, $http){
  
  $http.get("http://localhost:8080/json_test/notes2.php").then(function(response) {
              $scope.myText = response.data;
          });
  }]);
  &lt;/script&gt;
  
  &lt;script&gt;
  document.getElementById("demo").innerHTML = "{{myText}}";
  &lt;/script&gt;
  
  &lt;/body&gt;
  &lt;/html&gt;
  </code></pre>