title: "Unable to get property 'replace' of undefined or null reference" AngularJS Sharepoint 2013 IE9 Sharepoint web part grouped
body: <p>i get this browser error "Unable to get property 'replace' of undefined or null reference" when using AnguarJS with IE9 and Sharepoint 2013 on-prem and having a sharepoint web part grouped by any of the columns. IE10/11 and Chrome doesn't seem to have a problem. </p>
  
  <p>I can fix the error by declaring the  ng-app="myApp"  in the DIV of the control that i am creating. But i have a few controls on the page so i need to declare this in the main "html" element ideally. 
  <code>&lt;html  ng-app="myApp"&gt;</code> but every time i move the ng-app to a higher level it comes up with that error. Even when i move it to the "PlaceHolderMain" it still seems to error. This can be reproduced on an OOTB sharepoint page/masterpage. </p>
  
  <p>Just place this in the "head"</p>
  
  <pre><code>  &lt;script type="text/javascript" src="https://ajax.googleapis.com/ajax/libs/angularjs/1.4.4/angular.js"&gt;
          &lt;/script&gt;
  
          &lt;script type="text/javascript"&gt;
              angular.module('myApp', []);
  
          &lt;/script&gt;
  </code></pre>
  
  <p>then in the html element it should look somthing like </p>
  
  <pre><code>&lt;html  ng-app="myApp" class="fluid" xmlns:mso="urn:schemas-microsoft-com:office:office" xmlns:msdt="uuid:C2F41010-65B3-11d1-A29F-00AA00C14882"&gt;
  </code></pre>
  
  <p>You don't even need an angular control on the page to cause this error, just put a sharepoint web part grouped by a column on a page. </p>
  
  <p>Then when you go into IE9 developer toolbar you should get </p>
  
  <pre><code>{description: "Unable to g...", message: "Unable to g...", name: "TypeError", number: -2146823281}
  
  "Unable to get property 'replace' of undefined or null reference"
  </code></pre>
  
  <p>The problem has somthing to do with the sharepiont webpart sitting inside the ng-app, as there is not problem when the ng-app is declared in a div on the page with no sharepoint grouped webpart inside it.</p>