title: WinApp 8.1 (WinJS) App with AngularJS
body: <p>I am currently working on a prototyp on for testing the usability of several frameworks when developing a Win8.1 WinJS app. During the development I discovered a very strange behaviour with forms.</p>
  
  <p>This is the vanilla form of an freshly created WinJS App:</p>
  
  <p><img src="https://i.stack.imgur.com/Q5LVh.png" alt="enter image description here"></p>
  
  <p>What you can see is a cursor within the inputbox and half of the the copy button. Since the drop-in virtual keyboard would overlay the inputbox, it automatically scrolls the content upwards.</p>
  
  <p>Now I include AngularJS 1.3.1:</p>
  
  <p><img src="https://i.stack.imgur.com/EspD1.png" alt="enter image description here"></p>
  
  <p>Now, there is no cursor, the copy button doesn't appear and the drop-in keybord actually overlays the inputbox. It is actually not possible to change the position of the non visible cursor, so I can only prepend characters to any existing text.</p>
  
  <p>I analyzed the DOM tree of both versions:</p>
  
  <p>Vanilla:</p>
  
  <p><img src="https://i.stack.imgur.com/gTKi0.png" alt="enter image description here"> </p>
  
  <p>Angular 1.3.1 included:</p>
  
  <p><img src="https://i.stack.imgur.com/LHLSK.png" alt="enter image description here"></p>
  
  <p>What we can see is that angular nests a second level head within the head including some weird ass css definitions. Furthermore another body tag is created within the head element. I tried to remove those after loading angular using the following snippet:</p>
  
  <pre><code>&lt;script type="text/javascript"&gt;
    $(function () {
      $('head &gt; head, head &gt; body').remove();
    });
  &lt;/script&gt;
  </code></pre>
  
  <p>This solves the problem but now, ng-show, ng-hide directives do not work anymore.
  I can observe this problem only when using AngularJS in a WinJS API. I searched the internet but I didn't find any clues on that behaviour - there are actually several blogs out there describing the process of using AngularJS within a WinJS application without mentioning any such issues.</p>
  
  <p>Do you guys have any idea whats going on here?</p>