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
28
votes
2 answers

What does --minimal do in angular-cli `ng new`?

The Angular CLI has an option called --minimal. What does it do and where is it documented? The command ng help new says very little about it --minimal (Boolean) (Default: false) Should create a minimal app. aliases: --minimal
Evan Carroll
  • 78,363
  • 46
  • 261
  • 468
28
votes
3 answers

Generate inside module folder

I'm working with an Angular 2 application based on Angular-CLI skeleton, I had the habit of structuring my src folder with one directory by module, and each component related to this module in the same folder. src app documents …
LoïcR
  • 4,940
  • 1
  • 34
  • 50
28
votes
10 answers

Debug with Visual Studio Code not working

I'd like to be able to debug an Angular2 application with Visual Studio Code. Here's my environment: OS: Ubuntu 16.10 x64 Browser: Chromium 53.0.2785.143 Node: 6.8.0 Angular-cli: 1.0.0-beta.19-3 Creating a new project with angular-cli…
maxime1992
  • 22,502
  • 10
  • 80
  • 121
28
votes
2 answers

Where are files stored when running ng serve?

When I run ng serve, where are the files generated and stored? I need to troubleshoot why the app works with ng serve but not for production build. Forgot to mention that I'm using webpack version of angular-cli.
Sam
  • 1,288
  • 1
  • 13
  • 22
28
votes
4 answers

Converting an existing angular 2 project to use angular CLI

I have a project that was not created using ng new (rather, I followed the quickstart guide). When I run an angular CLI command in that project (such as ng generate) I get this error message: You have to be inside an angular-cli project in order to…
Coquelicot
  • 8,775
  • 6
  • 33
  • 37
27
votes
2 answers

NG Test show names in console

It can be quite difficult to identify a failing test when there is a fairly generic error (yes source maps is false) and would help greatly if we could show the test name instead of "executed 27 of 172" Something like "executed 27…
72GM
  • 2,926
  • 3
  • 27
  • 33
27
votes
4 answers

Angular 7 - service worker not registered

I did everything as written in "https://angular.io/guide/service-worker-getting-started" to make my application PWA. Used exactly this commands: ng add @angular/pwa npm install http-server -g ng build --prod http-server -p 8080 -c-1 dist Then I…
tzm
  • 588
  • 1
  • 12
  • 27
27
votes
8 answers

Cannot determine project or target for Architect command Angular

C:\Users\muhiuddin.TOWERTECH\test\testapp>ng build --target=production or C:\Users\muhiuddin.TOWERTECH\test\testapp>ng run When I run a new project or build it give me "Cannot determine project or target for Architect command" error. I am new to…
MUHIUDDIN
  • 323
  • 1
  • 4
  • 10
27
votes
9 answers

Angular 6 CLI -> how to make ng build build project + libraries

So the question is pretty basic but I can't find it. I created a new app through ng new my-project, followed by a ng g library my-library. Then I executed the command ng build, but is is only building my app, and not my library or my e2e projects.…
dendimiiii
  • 1,659
  • 3
  • 15
  • 26
27
votes
5 answers

Angular-universal getting error: You must pass in a NgModule or NgModuleFactory to be bootstrapped

I converted my existing angular-cli application to angular-universal by following this guide. You can look at my complete source code here. I am able to build both browser and client projects but I get following error when I view the app in the…
Saurabh Palatkar
  • 3,242
  • 9
  • 48
  • 107
27
votes
7 answers

Module not found: Error: Can't resolve './$$_gendir/app/app.module.ngfactory'

I get this below error after upgrading my angular-cli ERROR in Template parse errors: Can't bind to 'index' since it isn't a known property of 'tag'. ("own)="handleKeydown($event, item)" (onTagEdited)="onTagEdited.emit(item)" …
Karthikeyan VK
  • 5,310
  • 3
  • 37
  • 50
27
votes
3 answers

ng new my-app unexpected token =

I have installed the angular2 cli via npm, but when I try to create a new typescript angular app with the command 'ng new my-app' I keep getting this error: C:\Users\nicholas\AppData\Roaming\npm\node_modules\@angular\cli\models\config\config.js:15 …
Nicholas Pesa
  • 2,156
  • 2
  • 24
  • 45
27
votes
5 answers

How can I change the path of component generation to current path in angular-cli?

I'm following an angular 2 course where the instructor navigates into the specific path where he wants to generate a component and then runs the following command: ng generate component component-name After he runs it, the tool generates the files…
jacoviza
  • 988
  • 2
  • 9
  • 31
27
votes
3 answers

How to make material components work with Karma in unit testing Angular

I have an angular CLI project set up. I've made a form that uses angular material components, like . I'm just starting out with writing my first Karma/Jasmine unit test, following the steps in the angular docs. This is my component…
Snowman
  • 2,465
  • 6
  • 21
  • 32
27
votes
6 answers

Custom generated filename with Angular Cli

With Angular-cli the builded filename is main.[hash].bundle.js when use ng build -prod Is it possible to remove the hash form this filename. So just main.bundle.js?
sneeky
  • 1,458
  • 2
  • 13
  • 19