角2.0​​ - 自定义生成/进口和使用"在开发和QUOT;模 [英] Angular 2.0 - custom build/ import and use an "on develop" module

查看:91
本文介绍了角2.0​​ - 自定义生成/进口和使用"在开发和QUOT;模的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想与角2.0组件集成的角度1.X项目中,使用的升级模块

I want to play with integrating Angular 2.0 components inside an Angular 1.X project, using the upgrade module.

我想通了,这个模块是<一个href=\"http://stackoverflow.com/questions/33125045/integrating-angular-2-0-inside-angular-1-x-upgrade-module\">not公共/可用于阿尔法44.进口

I figured out that this module is not public/available for import in Alpha 44.

我不知道我怎样才能建立Angular2本地+导出此模块,这样我就可以导入它在我的本地项目? (我想我应该自己一口里面挖/建设,以这出)

I was wondering how can I build Angular2 locally + export this module so I'll be able to import it on my local project? (I guess I should dig inside their gulp/build in order to figure this out)

推荐答案

更新18/11/2015

由于阿尔法46 ngUpgrade 已经是可用的,所以下面的步骤都不再需要了。

Since alpha 46 ngUpgrade is already available, so the below steps are no longer necessary.

更新30/10/2015

截至今日提交在原来的答案引用被合并到主库 。所以,你可以跳过一些的这些步骤,并建立它遵循开发者指南

As of today the commit referenced in the original answer was merged to the main repository. So you can skip some of those steps and build it following the Developer guide.

原来的答复

好吧,我发现了一种方法。首先要注意MISKO COMMITED ngUpgrade到但它仍然没有合并angular2的主要回购,所以这几步骤将在短时间内改变,我想。

Well, I found a way. First note that Misko commited ngUpgrade to angular2's main repo but it's still not merged, so these few steps will change in a short time, I think.

步骤:


  • MISKO的回购

  • 更改为进口分支

  • Clone Misko's repo
  • Change to imports branch
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
      

      在所有这些步骤你必须捆在

      After all these steps you'll have the bundles under

      angular/dist/js/bundle
      

      下面是一个 plnkr 与缩小的包手动添加。

      Here's a plnkr with the minified bundle added manually.

      我希望这是你在找什么:)

      I hope this is what you are looking for :)

      这篇关于角2.0​​ - 自定义生成/进口和使用&QUOT;在开发和QUOT;模的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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