gpt4 book ai didi

javascript - 如何更改使用 NG Boilerplate 编译期间插入脚本/css 的顺序

转载 作者:行者123 更新时间:2023-12-02 17:55:37 24 4
gpt4 key购买 nike

我正在使用 NG Boilerplate 创建 angularJs 应用程序,但遇到了一个问题,其中包含登录 Controller 的 JS 文件在 loginModule.js 文件之前写入了 index.html,这导致了一堆错误。

有没有办法控制 JS(和 CSS)文件添加到编译页面的顺序?

最佳答案

也遇到这个问题

JS 文件按模块的字母顺序添加到您的 index.html 中。我通过在以下划线开头的文件中定义子模块(例如 _submodule.js)解决了这个问题,以确保它在使用该模块的其他文件之前添加到 index.html 中。

更多信息请点击:https://github.com/ngbp/ngbp/issues/152

来自此线程:

[...] 我需要一个多文件模块的解决方案,并想出了一些似乎有效的解决方案。在多文件模块文件夹中,我创建一个声明模块的 _init.js:

angular.module( 'ngBoilerplate.about', [
'ui.state',
'placeholders',
'ui.bootstrap'
])

;

然后我的其他 .js 文件可以执行此操作:

angular.module('ngBoilerplate.about')

.controller ...

;

关于javascript - 如何更改使用 NG Boilerplate 编译期间插入脚本/css 的顺序,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/20979958/

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