问题
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
add dependency on
ui.codemirror
module to/public/config.js
add
/public/lib/codemirror/codemirror.js
and/public/lib/codemirror/codemirror.css
to the assets in/config/env/all.js
However, neither the /public/config.js
, nor the /config/env/all.js
file exists.
Is this something that has been changed in version 0.4.2? If so, what are the new corresponding files where this info goes?
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.
回答1:
Those files have changed in the recent versions of MEAN.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:
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
.
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
.
来源:https://stackoverflow.com/questions/34985274/mean-js-and-adding-external-dependencies