如果增加的分类为空,那么不关闭页面

This commit is contained in:
luchenqun 2017-02-27 20:15:42 +08:00
parent 5bdacf3500
commit 4eda50a881
1 changed files with 2 additions and 1 deletions

View File

@ -216,10 +216,11 @@ app.controller('tagsCtr', ['$scope', '$filter', '$window', '$stateParams', '$tim
} }
$scope.addTag = function(tag) { $scope.addTag = function(tag) {
ngDialog.close(dialog);
console.log(tag); console.log(tag);
tag = tag.replace(/(^\s*)|(\s*$)/g, '').replace(/\s+/g, ' '); // 去除前后空格,多个空格转为一个空格; tag = tag.replace(/(^\s*)|(\s*$)/g, '').replace(/\s+/g, ' '); // 去除前后空格,多个空格转为一个空格;
if (tag) { if (tag) {
ngDialog.close(dialog);
var tags = []; var tags = [];
tags.push(tag); tags.push(tag);
bookmarkService.addTags(tags) bookmarkService.addTags(tags)