title: TypeError: Cannot read property 'charAt' of undefined Angularjs
body: <p>I keep getting error when going back in a page:</p>
  
  <pre><code>TypeError: Cannot read property 'charAt' of undefined
      at Object.Pb.$$parse (chrome-extension://jiflmhpffanabaldnciipnblmfjcjado/bower_components/angular/angular.min.js:86:140)
      at chrome-extension://jiflmhpffanabaldnciipnblmfjcjado/bower_components/angular/angular.min.js:90:313
      at k.$eval (chrome-extension://jiflmhpffanabaldnciipnblmfjcjado/bower_components/angular/angular.min.js:111:353)
      at k.$digest (chrome-extension://jiflmhpffanabaldnciipnblmfjcjado/bower_components/angular/angular.min.js:108:419)
      at chrome-extension://jiflmhpffanabaldnciipnblmfjcjado/bower_components/angular/angular.min.js:90:426
      at chrome-extension://jiflmhpffanabaldnciipnblmfjcjado/bower_components/angular/angular.min.js:38:222
      at Array.forEach (native)
      at q (chrome-extension://jiflmhpffanabaldnciipnblmfjcjado/bower_components/angular/angular.min.js:7:280)
      at f (chrome-extension://jiflmhpffanabaldnciipnblmfjcjado/bower_components/angular/angular.min.js:38:205)
      at chrome-extension://jiflmhpffanabaldnciipnblmfjcjado/bower_components/angular/angular.min.js:31:225 
  </code></pre>
  
  <p>Currently creating a chrome extension with angularjs being embedded into the page. My content.js file:</p>
  
  <pre><code>'use strict';
  window.addEventListener("load", function() {
      if ( window.location.host.match(/(stack|gmail|shopify|magento|zendesk|desk.com|)/) ){
          // load the app from all the other dependancies
          var app = angular.module('joggle_ecommerce', [
                  "joggle_ecommerce.controllers",
                  "joggle_ecommerce.services",
                  "joggle_ecommerce.directives"
              ])
          .config(function($locationProvider) {
              // $locationProvider.html5Mode(true).hashPrefix('!');
          })
  
          // find the html and add the angular needed directives
          var html = document.querySelector('html');
          html.setAttribute('ng-app', '');
          html.setAttribute('ng-csp', '');
  
  
  
  
  
          // bootstrap due to angular needing to load after page load
          angular.bootstrap(html, ['joggle_ecommerce'], []);
      }
  
  })
  </code></pre>
  
  <p>When I remove <code>angular.bootstrap(html, ['joggle_ecommerce'], []);</code>, this problem does not persist but from my knowledge I need to include the bootstrap with the extension because angular needs to load after page load. </p>