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
180
votes
6 answers

How to iterate using ngFor loop Map containing key as string and values as map iteration

I am new to angular 5 and trying to iterate the map containing another map in typescript. How to iterate below this kind of map in angular below is code for component: import { Component, OnInit} from '@angular/core'; @Component({ selector:…
Feroz Siddiqui
  • 3,840
  • 6
  • 34
  • 69
177
votes
9 answers

ERROR in The Angular Compiler requires TypeScript >=3.1.1 and <3.2.0 but 3.2.1 was found instead

I am getting this error ERROR in The Angular Compiler requires TypeScript >=3.1.1 and <3.2.0 but 3.2.1 was found instead. Seems like Typescript updated but the Angular Compiler doesn't like that. How do I fix this?
Matt
  • 33,328
  • 25
  • 83
  • 97
169
votes
25 answers

How to install a specific version of Angular with Angular CLI?

I searched through google and angular cli doc but couldn't find any way to install a specific version of Angular using Angular CLI. is it even possible?
Sajad
  • 3,376
  • 3
  • 20
  • 23
168
votes
3 answers

"Error: No provider for router" while writing Karma-Jasmine unit test cases

We have done one angular2 project set up and inside that created one module (my-module) and inside that module created one component (my-new-component) using following cmd commands: ng new angular2test cd angular2test ng g module my-module ng…
168
votes
20 answers

How to uninstall/upgrade Angular CLI?

When I try to create a new project with Angular CLI, with: ng n app I get this error: fs.js:640 return binding.open(pathModule._makeLong(path), stringToFlags(flags), mode); ^ TypeError: path must be a string or Buffer …
RohanArihant
  • 2,560
  • 4
  • 19
  • 29
161
votes
10 answers

Repository is not clean. Please commit or stash any changes before updating In Angular 8

Error Repository is not clean. Please commit or stash any changes before updating when i have updated from version 7 to Angular 8. Angular Guide for upgrade https://update.angular.io/#7.0:8.0 D:\app-test> ng update @angular/cli @angular/core …
afeef
  • 4,396
  • 11
  • 35
  • 65
157
votes
9 answers

angular-cli server - how to specify default port

Using angular-cli with the ng serve command, how can I specify a default port so I do not need to manually pass the --port flag every time? I'd like to change from the default port 4200.
elwyn
  • 10,360
  • 11
  • 42
  • 52
156
votes
14 answers

how to end ng serve or firebase serve

I've been doing web development with Angular2 and have been using both Angular2 and Firebase to run local servers. I haven't been able to find a command similar to typing quit when using Ionic to create a server, so I have to close the terminal tab…
aheigins
  • 2,574
  • 3
  • 19
  • 26
155
votes
10 answers

how to change the dist-folder path in angular-cli after 'ng build'

I would like to use angular-cli with asp.net core and I need to know how I can change the path of the dist folder
cuppy
  • 1,661
  • 2
  • 10
  • 6
154
votes
11 answers

Angular tests failing with Failed to execute 'send' on 'XMLHttpRequest'

I am trying to test my angular 4.1.0 component - export class CellComponent implements OnInit { lines: Observable>; @Input() dep: string; @Input() embedded: boolean; @Input() dashboard: boolean; constructor( public…
George Edwards
  • 8,979
  • 20
  • 78
  • 161
152
votes
25 answers

"Invalid Host header" when running Angular/cli development server c9.io

Current command: ng serve --host --public $IP:$PORT Results on my website: Invalid Host header
Olejs
  • 1,637
  • 2
  • 10
  • 6
150
votes
23 answers

How to get rid of the warning .ts file is part of the TypeScript compilation but it's unused

I Just updated angular to latest 9.0.0-next.4. I am not using routing but suddenly after updating I keep seeing this warning. How Do I remove this warning WARNING in src/war/angular/src/app/app-routing.module.ts is part of the TypeScript…
dota2pro
  • 7,220
  • 7
  • 44
  • 79
150
votes
27 answers

You seem to not be depending on "@angular/core". This is an error

I want to create an angular 2 App with angular cli I have written in the cmd: npm install angular-cli -g then: ng firstngapp but it show me an error when I write npm start ! I don't understand the problem
150
votes
13 answers

Get angular-cli to ng serve over HTTPS

The following doesn't seem to do anything. ng serve --ssl true --ssl-key --ssl-cert Creating the Certificate and key by providing them in the default ssl directory still does nothing. It looks like ng server is completely…
grim_i_am
  • 3,664
  • 5
  • 19
  • 19
149
votes
12 answers

Implementing a plugin architecture / plugin system / pluggable framework in Angular 2, 4, 5, 6

Update 5/24/2018: We are now +3 versions of Angular from my original post and still don't have a final workable solution. Lars Meijdam (@LarsMeijdam) has come up with an interesting approach which is certainly worth a look-see. (Due to proprietary…
Anthony Gatlin
  • 4,407
  • 5
  • 37
  • 53