增加书签分类,做限定

This commit is contained in:
luchenqun 2017-04-24 09:46:32 +08:00
parent 180830790a
commit e4c2fcd561
1 changed files with 4 additions and 0 deletions

View File

@ -326,6 +326,10 @@ app.controller('tagsCtr', ['$scope', '$filter', '$window', '$stateParams', '$tim
$scope.addTag = function(tag) { $scope.addTag = function(tag) {
console.log(tag); console.log(tag);
if($scope.tags.length >= 30){
toastr.error('标签个数总数不能超过30个不允许再添加新分类如有需求请联系管理员。', "提示");
return;
}
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); ngDialog.close(dialog);