Skip to content
This repository has been archived by the owner on Oct 24, 2024. It is now read-only.

Commit

Permalink
Fixed AOT compilation errors, closes #10
Browse files Browse the repository at this point in the history
  • Loading branch information
mdvorak committed Mar 21, 2017
1 parent b06498c commit ac89ddb
Show file tree
Hide file tree
Showing 6 changed files with 37 additions and 38 deletions.
4 changes: 4 additions & 0 deletions .npmignore
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
/codegen/
/coverage/
/node_modules/
/test.*
**/*.spec.*
**/*.ngsummary.json
**/*.ngfactory.ts
5 changes: 3 additions & 2 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -1,12 +1,13 @@
language: node_js
node_js:
- '6'

sudo: false

cache:
directories:
- node_modules

script:
- npm run testonce
- npm run build
- npm run ng build --prod
8 changes: 4 additions & 4 deletions example/app/app.component.html
Original file line number Diff line number Diff line change
@@ -1,14 +1,14 @@
<p>See <a href="http://docs.resourcerouterexample.apiary.io/#">API definition</a></p>

<template [resourceData] let-data [resourceDataOf]="apiLocation.url"
<ng-template [resourceData] let-data [resourceDataOf]="apiLocation.url"
(urlChange)="apiLocation.url=$event">
<h1>{{data.url}}</h1>
<resource-view [data]="data"></resource-view>
</template>
</ng-template>

<!-- TODO event not working -->
<!--TODO event not working-->
<!--<div *resourceData="let viewData of apiLocation.url"-->
<!--(urlChange)="navigate($event)">-->
<!--<h1>{{viewData.url}}</h1>-->
<!--<resource-view [data]="viewData"></resource-view>-->
<!--</div>-->
<!--</div>-->
17 changes: 3 additions & 14 deletions gulpfile.js
Original file line number Diff line number Diff line change
Expand Up @@ -22,9 +22,7 @@ gulp.task('clean', (cb) => {
/**
* Builds entire project.
*/
gulp.task('build', (cb) => {
runSequence('clean', ['tslint', 'ngc', 'assets', 'karma', 'bundle', 'compress'], cb);
});
gulp.task('build', ['tslint', 'ngc', 'assets', 'karma', 'bundle', 'compress']);

/**
* Lint all TypeScript files.
Expand All @@ -42,7 +40,7 @@ gulp.task('tslint', () => {
/**
* Run external Angular TypeScript compiler.
*/
gulp.task('ngc-exec', (cb) => {
gulp.task('ngc', (cb) => {
const exec = require('child_process').exec;
const path = require('path');

Expand All @@ -53,13 +51,6 @@ gulp.task('ngc-exec', (cb) => {
});
});

gulp.task('ngc', ['ngc-exec'], (cb) => {
const tsConfig = JSON.parse(fs.readFileSync('tsconfig.json', 'utf8'));
const codegenPath = tsConfig.angularCompilerOptions.genDir;

return del([codegenPath], cb);
});

/**
* Rollup config, creates UMD.
*/
Expand Down Expand Up @@ -108,9 +99,7 @@ gulp.task('assets', ['release-package', 'release-info']);
/**
* Run all tests once.
*/
gulp.task('test', (cb) => {
runSequence('clean', ['ngc', 'karma'], cb);
});
gulp.task('test', ['tslint', 'ngc', 'karma']);

gulp.task('karma', ['ngc'], (cb) => {
new Karma({
Expand Down
13 changes: 8 additions & 5 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -28,12 +28,15 @@
"gulp": "gulp",
"clean": "gulp clean",
"lint": "gulp tslint",
"pretest": "gulp clean",
"test": "gulp test:watch",
"pretestonce": "gulp clean",
"testonce": "gulp test",
"pretestaot": "gulp clean && gulp assets bundle",
"testaot": "ng build --prod",
"pretestaot": "gulp clean",
"testaot": "gulp assets bundle && ng build --prod",
"prestart": "gulp clean && gulp assets bundle",
"start": "ng serve",
"prebuild": "gulp clean",
"build": "gulp build",
"release": "gulp build && npm publish dist",
"postpublish": "gulp clean",
Expand All @@ -54,8 +57,8 @@
"@angular/cli": "1.0.0-rc.4",
"@angular/compiler-cli": "^4.0.0-rc.5",
"@angular/forms": "^4.0.0-rc.5",
"@angular/router": "^4.0.0-rc.5",
"@angular/platform-browser-dynamic": "^4.0.0-rc.5",
"@angular/router": "^4.0.0-rc.5",
"@types/jasmine": "~2.5.35",
"@types/node": "~6.0.45",
"codelyzer": "~2.0.0",
Expand All @@ -70,7 +73,7 @@
"gulp-tslint": "~7.1.0",
"gulp-uglify": "~2.1.0",
"jasmine-core": "~2.5.2",
"karma": "~1.4.1",
"karma": "^1.4.1",
"karma-chrome-launcher": "~2.0.0",
"karma-cli": "~1.0.1",
"karma-jasmine": "~1.1.0",
Expand All @@ -86,8 +89,8 @@
"run-sequence": "~1.2.2",
"source-map-loader": "^0.2.0",
"systemjs": "~0.19.41",
"ts-node": "~2.0.0",
"ts-loader": "^2.0.2",
"ts-node": "~2.0.0",
"tslint": "~4.4.2",
"typescript": "~2.1.5",
"webpack": "^2.2.1"
Expand Down
28 changes: 15 additions & 13 deletions tsconfig.json
Original file line number Diff line number Diff line change
@@ -1,23 +1,24 @@
{
"compilerOptions": {
"outDir": "dist",
"target": "es5",
"baseUrl": ".",
"declaration": true,
"stripInternal": true,
"experimentalDecorators": true,
"strictNullChecks": true,
"noImplicitAny": true,
"noFallthroughCasesInSwitch": true,
"module": "es2015",
"moduleResolution": "node",
"rootDir": ".",
"outDir": "dist",
"inlineSources": true,
"inlineSourceMap": true,
"removeComments": false,
"emitDecoratorMetadata": true,
"experimentalDecorators": true,
"target": "es5",
"skipLibCheck": true,
"lib": [
"es2015",
"dom"
],
"noImplicitAny": true,
"noFallthroughCasesInSwitch": true,
"suppressImplicitAnyIndexErrors": true,
"inlineSources": true,
"strictNullChecks": true,
"declaration": true
]
},
"files": [
"index.ts"
Expand All @@ -26,6 +27,7 @@
"src/**/*.ts"
],
"angularCompilerOptions": {
"genDir": "dist/codegen"
"genDir": "dist",
"strictMetadataEmit": true
}
}

0 comments on commit ac89ddb

Please sign in to comment.