0

我正在我的 Angular 5 项目中实现 SmartAdmin 的智能消息框。我收到 SmartMessageBox 不是 jquery 中的函数的错误。

我没有在堆栈溢出、互联网的其余部分和 SmartAdmin 文档中找到解决方案。我的同事说它可能是一个jquery插件,但我找不到它在哪里实现。

如何修复错误?

TypeError: $.SmartMessageBox is not a function
at NotificationService.smartMessageBox (notification.service.ts:21)
4

2 回答 2

0

我有同样的问题。我跳过了该函数并使用布尔值对其进行了硬编码

这是他们用那里的功能生成的代码。

白色 *ng 如果您可以决定何时显示消息框。

<div *ngIf="showMessageBox" class="divMessageBox animated fadeIn fast" id="MsgBoxBack">
<div class="MessageBoxContainer animated fadeIn fast" id="Msg1">
    <div class="MessageBoxMiddle"><span class="MsgTitle"><i class="fa fa-sign-out txt-color-orangeDark"></i> Logout <span
            class="txt-color-orangeDark"><strong>


                    {{userName}}

        </strong></span> ?</span>
        <p class="pText">Some text.</p>
        <div class="MessageBoxButtonSection">
            <button id="bot1-Msg1" class="btn btn-default btn-sm botTempo" (click)="cancel()"> No</button>
            <button id="bot2-Msg1" class="btn btn-default btn-sm botTempo" (click)="confirm()"> Yes</button>
        </div>
    </div>
</div>

于 2018-08-14T13:32:27.780 回答
0

在 Smartadmin 中,这是一个小错误,您可以试试这个

$.smallBox({
  title: "Synced Successfully",
  content: " Data Synced Done",
  color: "#659265",
  iconSmall: "fa fa-check fa-2x fadeInRight animated",
  timeout: 4000
});
$.fn.size = function () {
};

希望这对你有帮助

于 2018-03-13T07:49:46.113 回答