在Nativescript代码共享项目中使用Angular库
我正在尝试使用新的@nativescript/schematics
将Angular应用程序迁移到具有Nativescript的共享代码库,但是,在构建应用程序的移动版本时,导入Angular库时遇到了问题.我使用angular-cli创建了库(ng generate library
).
I'm trying to migrate an Angular app to a shared codebase with Nativescript using the new @nativescript/schematics
, however, I'm having problems importing my Angular library when building the mobile version of the app. I used the angular-cli to create the library (ng generate library
).
对于Web版本,我所要做的就是使用ng build library-name
分别构建库,然后将其导入到主应用程序中.
For the web version, all I had to do was build the library separately using ng build library-name
which then allowed me to import it into the main application.
我如何构建运行tns run ios --bundle
时可以导入到主应用程序中的库的移动版本?我已经使用适当的* .tns文件迁移了库的组件和模块.
How can I build a mobile version of the library that can be imported into the main application when running tns run ios --bundle
? I've already migrated the components and module of the library with appropriate *.tns files.
感谢您的帮助
很抱歉,这只是一个超链接答案,但我认为回答这个问题所需的空间太大.我刚刚完成了 repo 的工作,我一直在努力做到这一点.我现在有很多角度的网络库,现在我希望它们可以在使用NativeScript的移动设备上使用.我已经将到目前为止所学到的所有内容都放入了 repo ,希望对您有所帮助也是.
I'm sorry this is just a hyperlink answer but the space required to answer this, in my opinion, is way too large. I just finished finalizing a repo I've been working on to do exactly this. I have a whole slew of angular web libraries that I now want to make available for use on mobile using NativeScript. I have put everything I have learned so far into this repo and I hope it helps you too.
感谢最终的push/idea @Rohit,此回购文件的test-lib/gulpfile.js
中提供了执行他建议的脚本.
Thanks for the final push/idea @Rohit, a script for doing what he suggests is in the test-lib/gulpfile.js
of this repo.