diff --git a/components.js b/components.js new file mode 100644 index 0000000..f76cc98 --- /dev/null +++ b/components.js @@ -0,0 +1 @@ +exports.HelloWorld = require('./lib/HelloWorld').HelloWorld; diff --git a/example/index.html b/example/index.html index 598a004..ac22a3a 100644 --- a/example/index.html +++ b/example/index.html @@ -18,7 +18,7 @@ }, map: { 'ng2-translate': 'node_modules/ng2-translate', - 'angular2-library-example': 'node_modules/angular2-library-example/lib/angular2-library-example', + 'angular2-library-example': 'node_modules/angular2-library-example', 'rxjs': 'node_modules/rxjs' } }); diff --git a/example/src/App.ts b/example/src/App.ts index a357859..998bb97 100644 --- a/example/src/App.ts +++ b/example/src/App.ts @@ -3,10 +3,7 @@ import {Component} from 'angular2/core'; import {bootstrap} from 'angular2/platform/browser'; -import {HelloWorld} from 'angular2-library-example'; -//import {HelloWorld} from './HelloWorld'; -//import {HelloWorld} from '../jspm_packages/npm/angular2-library-example@1.0.2/lib/components/HelloWorld'; - +import {HelloWorld} from 'angular2-library-example/components'; import {TranslateService, TranslatePipe} from 'ng2-translate/ng2-translate'; diff --git a/package.json b/package.json index e4991ad..104ad16 100644 --- a/package.json +++ b/package.json @@ -2,6 +2,7 @@ "name": "angular2-library-example", "version": "1.0.2", "description": "An example repository for building your own Angular 2 library", + "main": "angular2-library-example.js", "scripts": { "watch": "tsc -p src -w", "build": "rm -rf lib && tsc -p src" diff --git a/src/components/HelloWorld.ts b/src/HelloWorld.ts similarity index 100% rename from src/components/HelloWorld.ts rename to src/HelloWorld.ts diff --git a/src/angular2-library-example.ts b/src/angular2-library-example.ts deleted file mode 100644 index 69c3311..0000000 --- a/src/angular2-library-example.ts +++ /dev/null @@ -1 +0,0 @@ -export {HelloWorld} from './components/HelloWorld'; \ No newline at end of file