Closed
Description
Hi,
When I include a component in another component, the ng serve
command renders the sub-component while ng serve --prod
does not render it. The same problem occurs when using the bundle created by command ng build --prod
.
- OS? Windows 7
- Versions.
(node:4412) fs: re-evaluating native module sources is not supported. If you are using the graceful-fs module, please update it to a more recent version.
angular-cli: 1.0.0-beta.11-webpack.2
node: 6.3.1
os: win32 x64 - how to reproduce ?
The Angular CLI base application (using ng new) can be used with the following changes.
Change app.component.ts with the following content.
import { Component } from '@angular/core';
import { SubComponent } from './sub.component';
@Component({
directives: [
SubComponent
],
selector: 'app-root',
template: `
<h1>
{{title}}
</h1>
<sub></sub>`
})
export class AppComponent {
title = 'app works!';
}
Create a new file sub.component.ts with the following content.
import { Component } from '@angular/core';
@Component({
selector: 'sub',
template: '<div>This is not render using --prod flag</div>'
})
export class SubComponent {
}
Then run ng serve
and then ng serve --prod
, the first one render SubComponent while the second one does not render it.
I have created a GitHub repository with the file to reproduce (here).
I tried to ask if I am missing something on stackoverflow but it seems it is a problem with cli ?
Metadata
Metadata
Assignees
Labels
No labels