我尝试使用NOT EXISTS(...)
提供程序为SELECT uid
FROM subscribes su
WHERE NOT EXISTS (SELECT *
FROM subscribes nx
WHERE nx.uid = su.uid AND nx.subscription_type = 'type1'
)
GROUP BY uid HAVING COUNT(*) > 2
;
回调设置默认函数。没有成功。
onTagAdding
除callBacks外,所有其他默认选项均已正确设置。另一方面,当我将其配置为属性时,它可以工作:
tagsInputConfig
有没有办法为这个回调设置默认函数?
答案 0 :(得分:2)
您可以将示波器中的任何功能定义为回调,这是一个示例
# test.html
<div ng-controller="MyCtrl">
<tags-input on-tag-adding="myFunction($tag)" ng-model="search"></tags-input>
</div>
在js文件中
angular.module('myModule').controller('MyCtrl', function($scope) {
$scope.myFunction = function($tag) {
console.log($tag);
return false;
};
});
希望它有所帮助!
答案 1 :(得分:1)
根据我从documentation (tags-input.js && configuration.js)可以看出的情况,看来onTagAdding不是您可以指定的默认值。
根据源代码,这里是直接从源代码中获得的完整列表( PS:第四个参数中对象的键是默认值的名称):
tagsInputConfig.load('tagsInput', $scope, $attrs, {
template: [String, 'ngTagsInput/tag-item.html'],
type: [String, 'text', validateType],
placeholder: [String, 'Add a tag'],
tabindex: [Number, null],
removeTagSymbol: [String, String.fromCharCode(215)],
replaceSpacesWithDashes: [Boolean, true],
minLength: [Number, 3],
maxLength: [Number, MAX_SAFE_INTEGER],
addOnEnter: [Boolean, true],
addOnSpace: [Boolean, false],
addOnComma: [Boolean, true],
addOnBlur: [Boolean, true],
addOnPaste: [Boolean, false],
pasteSplitPattern: [RegExp, /,/],
allowedTagsPattern: [RegExp, /.+/],
enableEditingLastTag: [Boolean, false],
minTags: [Number, 0],
maxTags: [Number, MAX_SAFE_INTEGER],
displayProperty: [String, 'text'],
keyProperty: [String, ''],
allowLeftoverText: [Boolean, false],
addFromAutocompleteOnly: [Boolean, false],
spellcheck: [Boolean, true]
});