0

toastr をアプリケーションに取り込もうとしています。私は非常に簡単なことをしました:

     bundles.Add(new ScriptBundle("~/Content/example-scripts").Include(
            "~/Areas/Examples/Scripts/vendor/*.js"
                   ));

そのフォルダに toastr.js が含まれています。そして、私の見解では:

   @Scripts.Render("~/Content/example-scripts")

toastr が Chrome に読み込まれているのがわかりますが、ビューモデルから toastr を呼び出すと、次のようになります。

$(document).ready(function () {
    toastr.success('sup');
    ko.applyBindings(new ViewModel());
});

次のエラーが表示されます。

Uncaught Error: Mismatched anonymous define() module: function ($) {
        return (function () {
            var version = '2.0.1';
            var $container;
            var listener;
            var toastId = 0;
            var toastType = {
                error: 'error',
                info: 'info',
                success: '...<omitted>...ch require.js:166
Uncaught ReferenceError: toastr is not defined sampleVm.js:36

私は何を間違っていますか?

4

1 に答える 1