Update noet-controller.js

This commit is contained in:
luchenqun 2019-01-10 16:06:00 +08:00
parent c55977e3c8
commit b10d36f06f
1 changed files with 4 additions and 1 deletions

View File

@ -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, "");
}