ui-codemirror icon indicating copy to clipboard operation
ui-codemirror copied to clipboard

Add ability to create codemirror with merge plugin, fixes #91

Open CarlAmbroselli opened this issue 10 years ago • 4 comments

This let's you use the merge plugin by adding merge-view to the directive.

Example:

<ui-codemirror
    merge-view
    ui-codemirror-opts="options"
    ng-model="editCopy">
</ui-codemirror>
$scope.options = {
        orig: 'StringToCompareWith',
        lineNumbers: true,
        highlightDifferences: true,
        connect: true,
        collapseIdentical: false
}

CarlAmbroselli avatar Nov 14 '15 18:11 CarlAmbroselli

I needed to use the merge plugin so I have done some functional testing of this PR. As far as I can tell this seems to work. I think it would be a good idea if these changes could be considered for integration.

LeSuisse avatar Dec 07 '15 12:12 LeSuisse

Hello,

Any news about this contribution ?

yannis-rossetto avatar Feb 24 '16 20:02 yannis-rossetto

I don't understand how to use merge plugin.

Both values (old and new) I receive from ajax ($resource), and on initialisation moment I have no values... What I should do?

html

js $scope.editorOptions = { mode: 'xml', lineNumbers: true, highlightDifferences: true, connect: true, collapseIdentical: false };

...GET { $scope.leftVar = val1; $scope.rightVar = val2; $scope.editorOptions.origLeft = $scope.rightVar; }

goldserg avatar Sep 26 '16 10:09 goldserg

I used hack. Wrap in ng-if and directive start only after ajax complete.

goldserg avatar Sep 27 '16 06:09 goldserg