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
1 answer

Ngrx filtered reducer with aot

I'm trying to use this reducer from ReduxJs site with NgRx and Angular Cli: function createFilteredReducer(reducerFunction, reducerPredicate) { return (state, action) => { const isInitializationCall = state === undefined; const…
bucicimaci
  • 1,261
  • 1
  • 9
  • 17
4
votes
0 answers

ERROR in Maximum call stack size exceeded production build error after upgrading from CLI 1.6.6/Angular 4.4.6 to 1.7.2/5.2.9

I followed these steps to upgrade my project. Get latest of branch to a clean folder. Package.json (shouldn't be necessary, just confirm) Update all angular versions to ^5.2.9 Update typescript to ~2.4. Update angular material to ^5.2.4 In…
Fred
  • 381
  • 2
  • 13
4
votes
2 answers

How to exclude browser modules from being built in Angular 5 Universal app

I'm trying to create an Angular Universal app building a specific route at build time to inject an AppShell into Index.html page as a means to get meaningful content in front of the user as soon as possible (while Angular app is downloading). I am…
Tom Schreck
  • 5,177
  • 12
  • 68
  • 122
4
votes
2 answers

How to test a component containing a third party directive

I have a basic component that contains the ngxPermissionsOnly directive which is working as expected. The library is on github here. I generated the component using the @angular-cli which also auto-generated the unit test. e.g.…
Jags
  • 1,639
  • 1
  • 16
  • 30
4
votes
0 answers

Import Sass variables into angular 5 component's typescript file

I want to share some scss variables with my javascript. So far I have done the following but it isn't working. Component import * as variables from 'sass-variable-loader!../styles/_variables.scss'; .angular.cli.json ... "scripts": [ …
christo8989
  • 6,442
  • 5
  • 37
  • 43
4
votes
3 answers

Parameterized Angular CLI build call from Maven (Eirslett's plugin)

I'm building a Java web app that packages in a WAR static resources. These static resources are built through Angular-CLI. The Maven build triggers the ng build through Eirslett's maven-frontend-plugin, with npm scripts and the npm mojo. Problem is,…
Silver Quettier
  • 2,045
  • 2
  • 26
  • 53
4
votes
2 answers

Angular-cli AOT build fails with "FATAL ERROR: CALL_AND_RETRY_LAST Allocation failed - JavaScript heap out of memory"

I am trying to build my angular-cli project with AOT ng build --aot but it failes with error "FATAL ERROR: CALL_AND_RETRY_LAST Allocation failed - JavaScript heap out of memory" The same thing happens if I build with the --prod flag. Any idea?
kishan oza
  • 61
  • 2
  • 6
4
votes
2 answers

Angular testing: "Illegal state: Could not load the summary for directive" for an empty component

None of my components were passing unit tests, so I made a new one in the project to try and diagnose. import { Component, OnInit } from '@angular/core'; @Component({ selector: 'app-thing', templateUrl: './thing.component.html', styleUrls:…
lewtur
  • 603
  • 1
  • 6
  • 16
4
votes
3 answers

Angular CLI get current port used

In Angular CLI you can set custom port with the --port command, --port=4201 for example. What I need to do is somehow get this port value so I can point to the correct server in my code but I'm unable to find such a way. The reason for this is…
Chrillewoodz
  • 27,055
  • 21
  • 92
  • 175
4
votes
3 answers

Sending updates to objects from client to nodejs

Currently I have an Angular2 app that has an object with nested objects contained in it. The user follows a wizard to update any sections of the object and then clicks save. At the moment, I just send the entire object to the server side to be…
Asagohan
  • 583
  • 5
  • 19
4
votes
3 answers

Angular 5 (tour of heroes) tutorial: Cannot find module '@angular-in-memory-web-api' error

I found a similar question but it was for angular2 & the commands in the answers seems angular2 specific or telling to run the same cmd I am running, so I am asking this question here. I am following the Angular 5 tour of heroes tutorial & in the…
Ahmed Elkoussy
  • 8,162
  • 10
  • 60
  • 85
4
votes
0 answers

How to get gradle exec task to print std out in real-time

I am executing a gradle exec task to build npm: task build(type: Exec) { commandLine "npm","run", "build" } However, it only prints all of the standard output from npm run build when the task is completed. Whereas if you run it manually, it…
james
  • 1,035
  • 2
  • 14
  • 33
4
votes
2 answers

How to exclude all files under a directory in lint using angular CLI?

We can exclude node_modules in this way. "lint": [ { "project": "src/main/webapp/app/file.json", "exclude": "**/node_modules/**" } ] But how to exclude all files under a directory? I tried below way. It is…
Ramya S
  • 2,954
  • 5
  • 14
  • 24
4
votes
0 answers

HMR not working in .Net Core 2.0 - Angular 5 new Single-App Template (angular/cli based)

I'm trying to create a new app with the new spa-templates from Microsoft, but HMR (Hot Module Replacement) is not working. I tried this. . Install the SPA templates: dotnet new --install…
4
votes
5 answers

Angular/CLI: How to change the port for auto reload?

As I understand when running ng serve the Angular app polls the dev server to find out if a reload is necessary. This server is expected to live on port 4200 (default). I run a dev environment with multiple docker container to keep things nice and…
Ole Spaarmann
  • 15,845
  • 27
  • 98
  • 160
1 2 3
99
100