Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Issues with setting content #24

Open
jaylucas opened this issue Aug 10, 2016 · 0 comments
Open

Issues with setting content #24

jaylucas opened this issue Aug 10, 2016 · 0 comments

Comments

@jaylucas
Copy link

jaylucas commented Aug 10, 2016

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]);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant