Angular 2.0 - 自定义构建/导入并使用 "on develop" 模块
Angular 2.0 - custom build/ import and use an "on develop" module
我想尝试使用 upgrade module 在 Angular 1.X 项目中集成 Angular 2.0 组件。
我发现这个模块是 Alpha 44 中的 not public/available for import。
我想知道如何在本地构建 Angular2 + 导出此模块,以便能够将其导入到我的本地项目中? (我想我应该深入了解他们的 gulp/build 才能弄明白)
2015 年 11 月 18 日更新
由于 alpha 46 ngUpgrade
已经可用,因此不再需要以下步骤。
2015 年 10 月 30 日更新
截至今天,原始答案中引用的提交已合并到 main repository. So you can skip some of those steps and build it following the Developer guide。
原回答
好吧,我找到了一个方法。首先请注意,Misko 提交了 ngUpgrade to angular2's main repo 但它仍未合并,因此我认为这几个步骤将在短时间内更改。
步数:
- 克隆Misko's repo
- 改为
imports
分支
sudo git checkout imports
- 安装依赖项
npm install
- 建造
// This will build only the js files
$(npm bin)/gulp build.js
// or both js and dart files
//$(npm bin)/gulp build
完成所有这些步骤后,您将在
下获得捆绑包
angular/dist/js/bundle
这是一个 plnkr 手动添加的压缩包。
希望这就是您要找的:)
我想尝试使用 upgrade module 在 Angular 1.X 项目中集成 Angular 2.0 组件。
我发现这个模块是 Alpha 44 中的 not public/available for import。
我想知道如何在本地构建 Angular2 + 导出此模块,以便能够将其导入到我的本地项目中? (我想我应该深入了解他们的 gulp/build 才能弄明白)
2015 年 11 月 18 日更新
由于 alpha 46 ngUpgrade
已经可用,因此不再需要以下步骤。
2015 年 10 月 30 日更新
截至今天,原始答案中引用的提交已合并到 main repository. So you can skip some of those steps and build it following the Developer guide。
原回答
好吧,我找到了一个方法。首先请注意,Misko 提交了 ngUpgrade to angular2's main repo 但它仍未合并,因此我认为这几个步骤将在短时间内更改。
步数:
- 克隆Misko's repo
- 改为
imports
分支
sudo git checkout imports
- 安装依赖项
npm install
- 建造
// This will build only the js files
$(npm bin)/gulp build.js
// or both js and dart files
//$(npm bin)/gulp build
完成所有这些步骤后,您将在
下获得捆绑包angular/dist/js/bundle
这是一个 plnkr 手动添加的压缩包。
希望这就是您要找的:)