-
Notifications
You must be signed in to change notification settings - Fork 11.9k
Closed
Labels
P1Impacts a large percentage of users; if a workaround exists it is partial or overly painfulImpacts a large percentage of users; if a workaround exists it is partial or overly painfultype: bug/fix
Description
I don't know how to best describe this in the title, maybe if someone has a suggestion.
The content (template) of the components I have in the declarations
array in my app.module.ts
, that are used within other components, don't show up at all when building with the "-prod" flag.
Steps to reproduce:
ng new my-app --directory ng.app
(I don't know why, but this sets "app" as prefix if you checkangular-cli.json
, I would have expected the prefix to be "my-app")cd ng.app
mkdir src/app/layout
ng generate component layout/header
- go into "app.module.ts" and correct the path from where the newly HeaderComponent is imported (this is a bug Angular-cli@1.0.0-beta.11-webpack.2 BUG - relative components generation #1714)
- go into
app.component.html
and add<app-header></app-header>
. - run
ng serve
and accesshttp://localhost:4200
. You see "app works!" and "header works!" - run
ng serve -prod
and accesshttp://localhost:4200
. Now you only see "app works!". The HeaderComponent template is not rendered anymore. If you inspect the dom, you can see the<app-header></app-header>
tag there. But it's empty.
No errors on build and no errors in the browser console.
angular-cli: 1.0.0-beta.11-webpack.2
node: 6.4.0
os: win32 x64
SylvestreMassalaz, osnoser1 and DutchKevv
Metadata
Metadata
Assignees
Labels
P1Impacts a large percentage of users; if a workaround exists it is partial or overly painfulImpacts a large percentage of users; if a workaround exists it is partial or overly painfultype: bug/fix