I'm rendering content of the editor using $http service. But onLoad function is being called much before data is rendered in editor.
When I'm adding code inside $timeout service then it is working properly. Is there any way to achieve this without using $timeout service.
funciton onLoad(editor) {
/*
It will set the some of the lines readyonly. But because onLoad is executing much
before data is rendered from $http service, it does not find any lines.
*/
set_readonly_lines(editor);
}
funciton onLoad(editor) {
/*
Using timeout it is working properly
*/
$timeout(function() {
set_readonly_lines(editor);
}, 1);
}