title: Scraping PHP and jQuery Ajax for AngularJS - Beginners
body: <p>For years, I have designed functioning web applications using PHP and jQuery. With technology having moved on substantially this approach is inefficient, slow and prone to errors.</p>
  
  <p>In getting started with Angular I would first like to understand if it is capable of effectively replacing where php echo would have been used in the past.</p>
  
  <p>Imagine an HTML div. The text contained within that div comes from a database, is rendered in php and echo'd into place.</p>
  
  <p>Now imagine that the content needs to change. The page would be reloaded with php rendering the new information.</p>
  
  <p>Angular appears to allow that a variable is placed within the div. Something like:</p>
  
  <pre><code>&lt;div&gt;{{variable}}&lt;/div&gt;
  </code></pre>
  
  <p>I would like to know if it is possible to use this method to update content on the fly. The idea would be that a new data object is loaded containing all the variables needed. Say, the language is changed and therefore, all the existing text should be updated to reflect the new language.</p>
  
  <ol>
  <li>Can angular do this?</li>
  <li>Is there a simple example that just shows something akin to the process above?</li>
  </ol>
  
  <p>The PHP way</p>
  
  <pre><code>&lt;? 
  
  if($_POST["spanish"){
      include('spanish_variables.php');
  }
  else {
      include('english_variables.php')
  }
  
  ?&gt;
  
  &lt;div class="content"&gt;
      &lt;h2&gt;&lt;? echo $variable_1-&gt;heading; ?&gt;&lt;/h2&gt;
      &lt;p&gt;&lt;? echo $variable_1-&gt;content; ?&gt;&lt;/p&gt;
  &lt;/div&gt;
  </code></pre>