title: Prerender.io: "angular.js:14525 TypeError: Cannot set property 'seo' of undefined"
body: <p><strong>EDIT</strong> I seem to have solved my problem, as I'm not getting the error anymore.</p>
  
  <p>I realized there was a lot of junk in this controller that I was no longer using, so I got rid of it, and also removed <code>var vm = this;</code>, and replaced all instances of <code>vm</code> with <code>$scope</code>.</p>
  
  <p><strong>Updated Code</strong></p>
  
  <pre><code>(function () {
  
  angular
      .module('app')
      .controller('screeningsController', Controller);
  
  function Controller($scope) {
      //var vm = this;
  
      $scope.seo = { 
          metaTitle : '', metaDescription : '' 
          }; 
  
      $scope.$parent.seo = { 
          metaTitle : 'Screenings', 
          metaDescripton: 'A list of all upcoming screenings for films.' 
          }; 
  
      }
  }
  
  )();
  </code></pre>
  
  <p>I'm having trouble implementing <a href="https://prerender.io/" rel="nofollow noreferrer">prerender.io</a>, and I've been getting the error <code>angular.js:14525 TypeError: Cannot set property 'seo' of undefined</code> in the browser console. </p>
  
  <p>I've been following along with this <a href="https://scotch.io/tutorials/angularjs-seo-with-prerender-io" rel="nofollow noreferrer">Scotch.io article</a>. I'm not really seeing where <code>seo</code> is "defined" in the code from the article. Here is the code I've incorporated from this article thus far:</p>
  
  <p><strong>index.html  tag</strong></p>
  
  <pre><code>&lt;!--prerender.io &amp; SEO--&gt;
  &lt;meta name="fragment" content="!"&gt;
  &lt;meta name="url" content="{{ seo.metaUrl }}"&gt;
  &lt;meta name="title" content="{{ seo.metaTitle }}"&gt;
  &lt;meta name="description" content="{{ seo.metaDescription }}"&gt;
  &lt;meta name="image" content="{{ seo.metaImage }}"&gt;
  </code></pre>
  
  <p><strong>angular.js controller</strong></p>
  
  <pre><code>(function () {
  
  angular
      .module('app')
      .controller('screeningsController', Controller);
  
  function Controller(ModalService) {
      var vm = this;
  
      vm.seo = { 
          metaTitle : '', metaDescription : '' 
          }; 
  
      vm.$parent.seo = { 
          metaTitle : 'Screenings', 
          metaDescripton: 'A list of all upcoming screenings for films.' 
          }; 
  
      //the rest of this code works fine
      vm.openModal = openModal;
      vm.closeModal = closeModal;
  
      function openModal(id){
          ModalService.Open(id);
      }
  
      function closeModal(id){
          ModalService.Close(id);
      }
  }
  
  })();
  </code></pre>
  
  <p>On a more general note, is this the most "modern" way of getting meta tags to work with Facebook? <a href="https://developers.google.com/webmasters/ajax-crawling/docs/learn-more" rel="nofollow noreferrer">The Google article discussing AJAX Crawling that is linked to from the Scotch.io page says that this has been deprecated since October 2015.</a></p>