forked from angular/angular-cli
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(@ngtools/webpack): remove annotations (angular#4301)
And move constructor arguments to a static property understood by Angular.
- Loading branch information
1 parent
990245f
commit ae62b95
Showing
5 changed files
with
169 additions
and
8 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
import {ng} from '../../../utils/process'; | ||
import {appendToFile, expectFileToMatch, prependToFile, replaceInFile} from '../../../utils/fs'; | ||
import {expectToFail} from '../../../utils/utils'; | ||
|
||
export default function() { | ||
return ng('generate', 'component', 'test-component', '--module', 'app.module.ts') | ||
.then(() => prependToFile('src/app/test-component/test-component.component.ts', ` | ||
import { Optional, SkipSelf } from '@angular/core'; | ||
`)) | ||
.then(() => replaceInFile('src/app/test-component/test-component.component.ts', | ||
/constructor.*/, ` | ||
constructor(@Optional() @SkipSelf() public test: TestComponentComponent) { | ||
console.log(test); | ||
} | ||
`)) | ||
.then(() => appendToFile('src/app/app.component.html', ` | ||
<app-test-component></app-test-component> | ||
`)) | ||
.then(() => ng('build', '--aot')) | ||
.then(() => expectToFail(() => expectFileToMatch('dist/main.bundle.js', /\bComponent\b/))) | ||
// Check that the decorators are still kept. | ||
.then(() => expectFileToMatch('dist/main.bundle.js', /ctorParameters.*Optional.*SkipSelf/)) | ||
.then(() => expectToFail(() => expectFileToMatch('dist/main.bundle.js', /\bNgModule\b/))); | ||
} |
6 changes: 3 additions & 3 deletions
6
tests/e2e/tests/build/aot-i18n.ts → tests/e2e/tests/build/aot/aot-i18n.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
4 changes: 2 additions & 2 deletions
4
tests/e2e/tests/build/aot.ts → tests/e2e/tests/build/aot/aot.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters