如何浏览-Shim Angular 2?

时间:2015-08-09 15:29:28

标签: angular browserify browserify-shim

任何人都知道如何使用Browserify-Shim Angular 2,同时保持Angular外部而不是在构建中捆绑它?

//package.json
{
  "name": "testapp",
  "version": "1.0.0",
  "main": "./app.js",
  "browserify-shim": {
    "angular2": "global:angular2"
  },
  "browserify": {
    "transform": [ "browserify-shim" ]
  },
  "dependencies": {
    "browserify-shim": "~3.2.0"
  }
}

...

//app.ts
import {Component, View, bootstrap, NgFor} from 'angular2';

结果:

TypeError: angular2_1 is undefined

0 个答案:

没有答案