I have the textarea contains the html code and some template jinja2 directives. So as you might guess the javascript crashed on page load, because Angular find some directives from jinja2 inappropriate ( for example {{ variable }} ). I mean these directives might be valid for Angular, but they are not event in a $scope, something like that...
I added recommended Angular directive ngBindTemplate both to textarea and even to div-wrapper, but this doesn't work.
Here is some source code from the browser:
<textarea id="body" name="body" ng-non-bindable=""><!DOCTYPE html>
<html lang="ru">
<head>
<meta charset="utf-8" />
<link rel="icon" href="/static/images/favicon.ico" type="image/x-icon" />
<link rel="shortcut icon" href="/static/images/favicon.ico" type="image/x-icon" />
<title>{% block title %}Title{% endblock %}</title>
<link href="/static/bootstrap/css/bootstrap.min.css" rel="stylesheet" />
<link rel="stylesheet" href="/static/css/styles.css" type="text/css" media="all" />
</head>
<body>
.....
</textarea>
As you can see the html inside textarea is escaped, but seems it make no sense to AngularJS and it compiles the content anyway.