docs: switch to commonjs module generation

This commit is contained in:
Ward Bell 2016-05-02 23:09:54 -06:00
parent 3d5302adce
commit cadd6c9823
14 changed files with 30 additions and 40 deletions

View File

@ -1,19 +1,11 @@
/* tslint:disable:no-unused-variable */
// #docplaster
import {Component, ViewEncapsulation} from '@angular/core';
// #docregion
// Let TypeScript know about the special SystemJS __moduleName variable
declare var __moduleName: string;
// #enddocregion
// moduleName is not set in some module loaders; set it explicitly
if (!__moduleName) {
__moduleName = `http://${location.host}/${location.pathname}/app/`;
}
console.log(`The __moduleName is ${__moduleName} `);
// #docregion
@Component({
moduleId: __moduleName,
moduleId: module.id,
selector: 'quest-summary',
// #docregion urls
templateUrl: 'quest-summary.component.html',

View File

@ -34,7 +34,7 @@
"rxjs": "5.0.0-beta.6",
"zone.js": "^0.6.12",
"angular2-in-memory-web-api": "0.0.5",
"angular2-in-memory-web-api": "0.0.6",
"bootstrap": "^3.3.6"
},
"devDependencies": {

View File

@ -1,3 +1,4 @@
// #docregion
/**
* System configuration for Angular 2 samples
* Adjust as necessary for your application needs.

View File

@ -1,7 +1,7 @@
{
"compilerOptions": {
"target": "es5",
"module": "system",
"module": "commonjs",
"moduleResolution": "node",
"sourceMap": true,
"emitDecoratorMetadata": true,

View File

@ -3,7 +3,7 @@ import { Component, OnInit } from 'angular2/core';
import { ToastService } from './toast.service';
@Component({
moduleId: __moduleName,
moduleId: module.id,
selector: 'toh-toast',
templateUrl: '<div>toast</div>'
})

View File

@ -3,7 +3,7 @@ import { Component, OnInit } from 'angular2/core';
import { ToastService } from './toast.service';
@Component({
moduleId: __moduleName,
moduleId: module.id,
selector: 'toh-toast',
templateUrl: '<div>toast</div>'
})

View File

@ -1,7 +1,7 @@
import { Component, EventEmitter, Output } from 'angular2/core';
@Component({
moduleId: __moduleName,
moduleId: module.id,
selector: 'toh-filter-text',
template: '<div>filter</div>'
})

View File

@ -3,7 +3,7 @@ import { Component, OnInit } from 'angular2/core';
import { ModalService } from './modal.service';
@Component({
moduleId: __moduleName,
moduleId: module.id,
selector: 'toh-modal-confirm',
template: '<div>modal</div>'
})

View File

@ -3,7 +3,7 @@ import { Component, OnInit } from 'angular2/core';
import { ModalService } from '../';
@Component({
moduleId: __moduleName,
moduleId: module.id,
selector: 'toh-nav',
template: '<div>nav</div>'
})

View File

@ -3,7 +3,7 @@ import { Component, OnInit } from 'angular2/core';
import { ToastService } from './toast.service';
@Component({
moduleId: __moduleName,
moduleId: module.id,
selector: 'toh-toast',
templateUrl: '<div>toast</div>'
})

View File

@ -1 +1 @@
declare var __moduleName: any;
declare var module.id: any;

View File

@ -5,17 +5,6 @@ import { Component, EventEmitter, Injectable, Input, Output,
import { Observable } from 'rxjs/Rx';
// Let TypeScript know about the special SystemJS __moduleName variable
declare var __moduleName: string;
// moduleName is not set in some module loaders; set it explicitly
if (!__moduleName) {
__moduleName = `http://${location.host}/${location.pathname}/app/`;
}
// console.log(`The __moduleName is ${__moduleName} `);
////////// The App: Services and Components for the tests. //////////////
////////// Services ///////////////
@ -136,7 +125,7 @@ export class TestViewProvidersComp {
@Component({
moduleId: __moduleName,
moduleId: module.id,
selector: 'external-template-comp',
templateUrl: 'bag-external-template.html'
})

View File

@ -1,7 +1,7 @@
{
"compilerOptions": {
"target": "es5",
"module": "system",
"module": "commonjs",
"moduleResolution": "node",
"sourceMap": true,
"emitDecoratorMetadata": true,

View File

@ -475,14 +475,19 @@ figure.image-display
.file app.component.ts
.file main.ts
.file node_modules ...
.file typings ...
.file typings
.children
.file typings.d.ts
.file ...
.file index.html
.file package.json
.file styles.css
.file system.config.js
.file tsconfig.json
.file typings.json
:marked
And here are the files:
And here are the files:,
quickstart/ts/typings/typings.d.1.ts
+makeTabs(`
quickstart/ts/app/app.component.ts,
quickstart/ts/app/main.ts,
@ -490,14 +495,17 @@ figure.image-display
quickstart/ts/package.1.json,
quickstart/ts/tsconfig.1.json,
quickstart/ts/typings.1.json,
quickstart/ts/styles.1.css
`,null,
quickstart/ts/styles.1.css,
quickstart/ts/system.config.1.js`
,null,
`app/app.component.ts,
app/main.ts,
index.html,package.json,
index.html,
package.json,
tsconfig.json,
typings.json,
styles.css`)
styles.css,
system.config.js`)
:marked
.l-main-section