Angular2插件机制 [英] Angular2 Plugin Mechanism

查看:81
本文介绍了Angular2插件机制的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我用angular-cli创建了一个新的Angular2项目.我将其包装到Electron中以用作桌面应用程序.该应用程序或多或少是一个简单的窗口,中间带有导航栏和加号.单击加号应允许导入插件"以丰富应用程序.插件本身就是完整的Angular2项目,带有它们自己的package.json和依赖项.如有必要,可以将它们与webpack打包在一起.有没有办法做到这一点?

I created a new Angular2 project with angular-cli. I wrapped it into Electron to use it as a desktop application. The app is more or less a simple window with a navbar and a plus sign in the middle. Clicking the plus should allow importing 'Plugins' to enrich the application. Plugins are complete Angular2 Projects itself, coming with their own package.json and dependencies. They could be packaged with webpack if necessary. Is there a way/approach to do this?

谢谢

推荐答案

您可以引用@Gijs代码

you can refer the @Gijs code

https://github.com/PacktPublishing/Mastering-Angular-2-Components/tree/master/angular-2-components-chapter-10

,也可以使用webpack捆绑该应用程序( https ://angular.io/docs/ts/latest/guide/webpack.html#!#top )或gulp(

and also can bundle the app by using webpack (https://angular.io/docs/ts/latest/guide/webpack.html#!#top) or gulp(https://www.codeproject.com/Articles/1115444/Developing-And-Deploying-An-Angular-Application-Wi).

这篇关于Angular2插件机制的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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