Commit 67efe969 by Jason Song Committed by GitHub

Merge pull request #502 from lepdou/1226

bugfix: diff directive undifined exception
parents 5b36cc6e 0a1199f8
......@@ -29,7 +29,10 @@ directive_module.directive('apollodiff',
span = null,
pre = '';
var diff = JsDiff.diffLines(scope.oldStr, scope.newStr),
var oldStr = scope.oldStr == undefined ? '' : scope.oldStr;
var newStr = scope.newStr == undefined ? '' : scope.newStr;
var diff = JsDiff.diffLines(oldStr, newStr),
fragment = document.createDocumentFragment();
diff.forEach(function (part) {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment