Update noet-controller.js
This commit is contained in:
parent
c55977e3c8
commit
b10d36f06f
|
|
@ -190,6 +190,9 @@ app.controller('noteCtr', ['$scope', '$state', '$stateParams', '$filter', '$wind
|
||||||
}
|
}
|
||||||
|
|
||||||
$scope.updateNote = function () {
|
$scope.updateNote = function () {
|
||||||
|
if(!$scope.content) {
|
||||||
|
toastr.error('更新失败,更新内容不能为空', "提示");
|
||||||
|
}
|
||||||
var tagName = '';
|
var tagName = '';
|
||||||
$scope.tags.forEach((tag) => {
|
$scope.tags.forEach((tag) => {
|
||||||
if ($scope.currentTagId === tag.id) {
|
if ($scope.currentTagId === tag.id) {
|
||||||
|
|
@ -363,7 +366,7 @@ app.controller('noteCtr', ['$scope', '$state', '$stateParams', '$filter', '$wind
|
||||||
.then((data) => {
|
.then((data) => {
|
||||||
$scope.notes = data.notes;
|
$scope.notes = data.notes;
|
||||||
$scope.notes.forEach((note) => {
|
$scope.notes.forEach((note) => {
|
||||||
note.brief = note.content;
|
note.brief = note.content || "";
|
||||||
while (note.brief.indexOf("\n") > 0) {
|
while (note.brief.indexOf("\n") > 0) {
|
||||||
note.brief = note.brief.replace(/\n/g, "");
|
note.brief = note.brief.replace(/\n/g, "");
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue