As @Michael suggested, Ace is evaluating var editor = ace.edit("editor")
before the content of the page is loaded.
Instead of using the script in the html or in an external script I had to put the script code inside the page2.html
controller....
function page2Ctrl ($scope, $http) {
var editor = ace.edit("editor");
editor.setTheme("ace/theme/twilight");
editor.getSession().setMode("ace/mode/javascript");
}
When app goes on page2.html
the page's ctrl gets initiated.