Mean.JS并添加外部依赖项 [英] Mean.JS and adding external dependencies

查看:90
本文介绍了Mean.JS并添加外部依赖项的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在尝试将外部依赖ui.codemirror添加到我的Mean.JS 0.4.2应用程序中.

I am attempting to add the external dependency ui.codemirror to my Mean.JS 0.4.2 application.

我在此处的理解此处的步骤如下:

My understanding from here and here of the steps is as follows:

  • bower install --save angular-ui-codemirror

将对ui.codemirror模块的依赖项添加到/public/config.js

add dependency on ui.codemirror module to /public/config.js

/public/lib/codemirror/codemirror.js/public/lib/codemirror/codemirror.css添加到/config/env/all.js

但是,/public/config.js/config/env/all.js文件都不存在.

However, neither the /public/config.js, nor the /config/env/all.js file exists.

这是在0.4.2版中更改的吗?如果是这样,此信息将移至哪些新的对应文件中?

Is this something that has been changed in version 0.4.2? If so, what are the new corresponding files where this info goes?

如果没有,我想念的是什么?我尝试创建自己的/config/env/all.js文件并将这些文件添加到资产中,但是这些文件从未发送到客户端.关于如何从这里继续,我感到很困惑.

If not, what is it that I am missing? I tried creating my own /config/env/all.js file and adding the files to the assets, but those files are never sent to the client. I'm pretty stumped, as to how to proceed from here.

推荐答案

这些文件在MEAN.JS的最新版本中已更改.

Those files have changed in the recent versions of MEAN.JS.

您应该将angular-ui-codemirror的路径添加到config/assets/default.js.无需创建新的配置文件.

You should add the paths to angular-ui-codemirror to config/assets/default.js. There is no need to create new config files.

更新:

Update:

如果您使用的是0.3.3版,则必须更新config/env/all.js文件,在该文件中放置依赖文件的路径,并且如果它是一个有角度的第三方模块,那么您还需要将其注入您的主角度模块中,可以在文件public/config.js中完成.

If you're using version 0.3.3 you have to update the config/env/all.js file where you place the path to your dependency file and in case it is an angular 3rd party module you also have to inject it in your main angular module which can be done in the file public/config.js.

如果您使用的是0.4.2版,则必须更新config/assets/default.js文件,在该文件中放置依赖文件的路径,并且如果它是有角度的第三方模块,那么您还需要将其注入您的主角度模块中,可以在文件modules/core/client/app/config.js中完成.

If you're using version 0.4.2 you have to update the config/assets/default.js file where you place the path to your dependency file and in case it is an angular 3rd party module you also have to inject it in your main angular module which can be done in the file modules/core/client/app/config.js.

这篇关于Mean.JS并添加外部依赖项的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆