Answer the question
In order to leave comments, you need to log in
Answer the question
In order to leave comments, you need to log in
In src/environments are environment.ts, environment.prod.ts. In dev mode, the first is used, in prod - the second. And by default there is at least one field - production: true/false.
Accordingly, in your module file we write something like this:
let declarations = [SomeComponent];
if (!environment.production) {
const devDeclarations = [/*ваши дев компоненты*/];
declarations = declarations.concat(devDeclarations); // равносильно [...declarations, ...devDeclarations]
}
@NgModule({
declarations,
/*...*/
})
export class SomeModuleClass {}
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question