From c269c2e8182b55e0219ae10b50200b087bdc26a1 Mon Sep 17 00:00:00 2001 From: Your Name Date: Tue, 29 Dec 2015 19:44:24 +0000 Subject: [PATCH] adding jspm-based example --- components.js | 1 + example/index.html | 2 +- example/src/App.ts | 5 +---- package.json | 1 + src/{components => }/HelloWorld.ts | 0 src/angular2-library-example.ts | 1 - 6 files changed, 4 insertions(+), 6 deletions(-) create mode 100644 components.js rename src/{components => }/HelloWorld.ts (100%) delete mode 100644 src/angular2-library-example.ts 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