Angular break on InnerHTML append

by Aides

HTML

<div ng-app="app">
  <div ng-controller="testCtrl as test">
    <button ng-click="test.foo()" value="Foo">
      Foo
    </button>
    <button ng-click="test.bar()" value="Bar">
      Bar
    </button>
  </div>
</div>

JavaScript

angular.module('app', [])
  .controller('testCtrl', ['$scope', function($scope) {
  	var self = this;
    
    self.data = ["test"];
             
    self.foo = function()
    {
    	log("foo");
    };
    
    self.bar = function()
    {
    	console.log('bar');
    };
  }]);

function log(text)
{
  document.body.innerHTML += text + '<br>';
}