Skip to content
This repository was archived by the owner on Sep 8, 2020. It is now read-only.
This repository was archived by the owner on Sep 8, 2020. It is now read-only.

Initializing ace editor content using $http service #177

@prashant-pokhriyal

Description

@prashant-pokhriyal

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);
}

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions