gpt4 book ai didi

javascript - 如何引用 Angular 值,以便引用不会在缩小时被破坏

转载 作者:行者123 更新时间:2023-12-02 16:16:26 25 4
gpt4 key购买 nike

以下代码在小型化之前工作正常。本质上,editableOptions 是 angular-xeditable 库提供的 Angular 值。

angular.module('common').run(function(editableOptions) {
editableOptions.theme = 'bs3';
}
)

但是,当我缩小时,我收到注入(inject)错误。我相信这是因为 editableOptions 正在变得越来越小。我怎样才能以不同的方式引用它,以免发生这种情况?是否有某种方式以 angular.module('xeditable') 开头引用它?

最佳答案

使用定义注入(inject)对象的缩小安全方法:

angular.module('common').run(
['editableOptions',
function(editableOptions) {
editableOptions.theme = 'bs3';
}
]);

关于javascript - 如何引用 Angular 值,以便引用不会在缩小时被破坏,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/29526177/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com