From b10d36f06f4833f4ec8e9105677a77993e59dc61 Mon Sep 17 00:00:00 2001 From: luchenqun Date: Thu, 10 Jan 2019 16:06:00 +0800 Subject: [PATCH] Update noet-controller.js --- public/scripts/controllers/note-controller.js | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/public/scripts/controllers/note-controller.js b/public/scripts/controllers/note-controller.js index ee26eb7..c5ee6d9 100644 --- a/public/scripts/controllers/note-controller.js +++ b/public/scripts/controllers/note-controller.js @@ -190,6 +190,9 @@ app.controller('noteCtr', ['$scope', '$state', '$stateParams', '$filter', '$wind } $scope.updateNote = function () { + if(!$scope.content) { + toastr.error('更新失败,更新内容不能为空', "提示"); + } var tagName = ''; $scope.tags.forEach((tag) => { if ($scope.currentTagId === tag.id) { @@ -363,7 +366,7 @@ app.controller('noteCtr', ['$scope', '$state', '$stateParams', '$filter', '$wind .then((data) => { $scope.notes = data.notes; $scope.notes.forEach((note) => { - note.brief = note.content; + note.brief = note.content || ""; while (note.brief.indexOf("\n") > 0) { note.brief = note.brief.replace(/\n/g, ""); }