我DO在Postgres数据库中有一个匿名块,如下所示:
DO LANGUAGE plpgsql $$
DECLARE
FUNC_ID smallint;
BEGIN
SELECT COUNT(1) INTO FUNC_ID FROM FUNCTION WHERE NAME = 'addition';
IF FUNC_ID = 0 THEN
INSERT INTO FUNCTION ( ID, NAME, DESCRIPTION, FUNCTION)
values ((select (max(id)+1) from FUNCTION), 'subtraction'
, 'calculate', 'catalog');
END IF;
END;
$$;
Run Code Online (Sandbox Code Playgroud)
如果执行这段代码,它只给出输出DO.
如何将整个代码块输出到控制台?
我有以下 css 来申请mdToast不同的响应,例如成功、错误、信息、警告。
md-toast.md-error-toast-theme div.md-toast-content{
color: white !important;
background-color: red !important;
}
md-toast.md-success-toast-theme div.md-toast-content{
color: white !important;
background-color: green !important;
}
Run Code Online (Sandbox Code Playgroud)
我想将此主题 css 应用到 mdToast 下面
$mdToast.show({
templateUrl:'views/toast-template.html',
controller:'ToastCtl',
hideDelay:5000,
controllerAs: 'toast',
bindToController: true,
locals:{message:message,type:type}
});
Run Code Online (Sandbox Code Playgroud)
我能够成功使用主题或模板。但是,我无法同时使用模板和主题。