Questions tagged [angular-cli]

The Angular CLI is a command line interface for building, managing and deploying Angular (version 2+) applications.

The Angular CLI is a command line interface for building, managing and deploying Angular (version 2+) applications. It can be used to generate part of the application, serving in a local server, analysing code quality, etc. It is based on ember-cli project.

Installation

npm install -g @angular/cli

Usage

ng help

Generating and serving an Angular project via a development server

ng new PROJECT-NAME
cd PROJECT-NAME
ng serve

For more information, please visit the following links.

7329 questions
4
votes
2 answers

Angular CLI & Angular Universal cannot get environment.production to be true on server with --prod

I set up my web app using the Universal Starter - here and am trying to use environment.production to switch between a production config and a development config inside ./src/config/server.config.ts but the value is always false. When I check the…
4
votes
1 answer

Bundle size increased after upgrading to Angular 6 (from 5)

I have a large (hundreds of components) angular (5.2.4) app. I upgraded the following, and am able to build clean, but the resulting bundle sizes are larger than with v5: Node.js and Angular CLI updated Http converted to use HttpClient rxjs…
skeize
  • 81
  • 4
4
votes
3 answers

Angular (CLI) 6 - Local library publishing

I have made my first library, using the new angular-cli command: library. After I build the library I wanted to import it into an existing project (without publishing to npm), but unfortunately without luck.. Actually, it works if I copy it into…
Beese
  • 495
  • 2
  • 5
  • 19
4
votes
4 answers

HMR is not updating the view with Angular CLI

I recently updated my angular app to the latest versions. And after a night of nightmares of bug, I got everything working except for HMR. I am badly stuck with it. Following are my configurations according to the the HMR Story on Angular CLI…
Metabolic
  • 2,808
  • 3
  • 27
  • 41
4
votes
1 answer

How do I find out which version of angular-cli a version of nodejs support?

I'm using nodejs v8.8.1 and angular-cli v6.0.8 and I got this error: You are running version v8.8.1 of Node.js, which is not supported by Angular CLI v6. The official Node.js version that is supported is 8.9 and greater. If I'm going to…
matchifang
  • 5,190
  • 12
  • 47
  • 76
4
votes
1 answer

Import js component into Angular 5

I'm new to Angular and still trying to learn the technology. I have an Angular 5 app that I want to use a JS component in. This is probably a more general question, but here are my specifics. Setup: VS Code, Angular 5 Component:…
4
votes
1 answer

How do I conditionally compile environment-specific template in Angular

I have Angular 5 application with several environments (dev, qa, customer1, customer2, etc.). Using environment.xxx.ts I get runtime configuration variables with no problem. However, I can't conditionally include a template during compilation. That…
Felix
  • 9,248
  • 10
  • 57
  • 89
4
votes
2 answers

change angular env variables at runtime

I would like to be able to change the url on which my angular will fetch ressources from the server at build time. I would to pass a parameter during the build to change the url value The reason behind is for deployment in different docker…
edkeveked
  • 17,989
  • 10
  • 55
  • 93
4
votes
1 answer

Angular CLI tests and enums

I am struggeling with Angular CLI's test framework and enum types. I am creating an enum like this (in someenum.ts): const enum SomeEnum { Val0, Val1 } And using it like this (in app.component.ts): private someEnum = SomeEnum.Val0; If I run…
Rune G
  • 1,447
  • 2
  • 12
  • 26
4
votes
1 answer

Inheriting from an abstract class has issue with Dependency Injection

I have a parent abstract class declared like the following : import { Localization } from 'angular-l10n'; import { SomeModel} from '../../api/models/some-model'; import { SomeService } from '../../api/services/some.service'; export abstract class…
Deblaton Jean-Philippe
  • 11,188
  • 3
  • 49
  • 66
4
votes
3 answers

Angular keeps automatically reloading

Angular keeps automatically reloading when using: ng serve This behaviour only happens on my computer. iMac Late 2013 OS: OSX High Sierra
axelferreira
  • 1,990
  • 1
  • 12
  • 10
4
votes
2 answers

Does angular-cli's environmentSource file always loaded?

I searched the docs and couldn't find the answer, does angular-cli's 'environmentSource' file is always loaded no matter what environment i choose? (e.g. prod) I'm setting my project to work with different env files for dev,staging and prod and…
Raz Zelinger
  • 686
  • 9
  • 24
4
votes
3 answers

Migration from angular 5 to angular 6 - changes in @angular/core

I've upgraded my project from angular 5.2.9 to angular 6.0.0-rc.5. Except few quick RxJS fixes in the packages path, all looks good. (This link was quiet helpful : Want to upgrade project from Angular 5 to Angular 6) But, for some reason i'm…
Rot-man
  • 18,045
  • 12
  • 118
  • 124
4
votes
1 answer

Angular 4/5 - Change base href dynamically

I am working on a multi-tenant application with Ex URL: "https://example.com/{portalID}/Login" where portalID changes customer to customer. So the initial login looks like this. https://example.com/portalId/Login In the login page, I have a text box…
user1985943
  • 83
  • 1
  • 3
  • 9
4
votes
2 answers

How to auto compile angular 5 application when there are any code changes presented

We have a AngularJS application that contains separate angular applications that run independently. each module is in a separate path like localhost:8080/OurMainApplication/angular1Application1 …
RoHaN
  • 1,356
  • 2
  • 11
  • 21