Skip to content

Issues with setting content #24

Description

@jaylucas

So I am having issues setting the content after initialization of the markdown editor.

 debugger;  // $scope.candidateInfo.notes <--- has a string in it
$('#editor').markdownEditor('setContent', $scope.candidateInfo.notes);

I get a :

  TypeError: Cannot read property 'env' of undefined

Any idea why? This is the order of execution:

    $('#editor').markdownEditor({
        preview: true,
        onPreview: function (content, callback) {
            callback( marked(content) );
        }
    });


    someService.getById($routeParams.id).then(
        function(response){
            $scope.candidateInfo = response.data;
            debugger;
            $('#editor').markdownEditor('setContent', $scope.candidateInfo.notes);
        }
    );

if it helps it is breaking on this line:

var editor = ace.edit(this.find('.md-editor')[0]);

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions