angular-cli-v6

[Angular-CLI-6]Could not determine single project for 'Serve' target

▼魔方 西西 提交于 2020-01-02 03:32:26
问题 I have updated my angular-cli with the help of ng update @angular/cli command. After that, I have got an error as Could not determine single project for 'server' target with following error trace. Could not determine a single project for the 'serve' target. Error: Could not determine a single project for the 'serve' target. at ServeCommand.getProjectNamesByTarget (E:\Angular\Projects\projectName\node_modules\@angular\cli\models\architect-command.js:175:19) at ServeCommand.<anonymous> (E:

Angular : Unable to pass API url in SignalR HubConnection

偶尔善良 提交于 2020-01-01 11:49:28
问题 I have developed a project in Angular6. There is a requirement to develop section for live chat. For that I am using SignalR in my asp.net core Web Apiproject. Now I want to use this Web Api reference in my Angular project. I am using this link. But while providing the Web Api url in App.Component.ts, I am getting below error : Constructor of class 'HubConnection' is private and only accessible within the class declaration. App Component.ts : import { HubConnection } from '@aspnet/signalr';

Angular CLI Generate Library with SASS

余生颓废 提交于 2020-01-01 05:11:28
问题 I have an Angular6 app that I am trying to create a library for. I was able to generate a library project but when I generate the component for the library, Angular CLI is creating it with .css files. How can I get it to create .scss files? Here are the commands I'm using to create the project: ng new example-app --style=scss rename example-app example cd example ng generate library example --prefix=exam --style=scss ng generate component test --project=example The --style=scss option on the

Angular CLI Generate Library with SASS

烈酒焚心 提交于 2020-01-01 05:11:19
问题 I have an Angular6 app that I am trying to create a library for. I was able to generate a library project but when I generate the component for the library, Angular CLI is creating it with .css files. How can I get it to create .scss files? Here are the commands I'm using to create the project: ng new example-app --style=scss rename example-app example cd example ng generate library example --prefix=exam --style=scss ng generate component test --project=example The --style=scss option on the

Is it possible to generate multiple Angular components using single angular-cli command like ng generate component comp1, comp2, comp3?

旧街凉风 提交于 2019-12-30 02:19:06
问题 I need to create ten Angular components like comp1, comp2, comp3, comp4, ..., comp10. So I need to execute same command for ten times for each component like ng g c comp1, ng g c comp2, etc. Is there any option to generate multiple angular components using single angular-cli command like ng g c comp1, comp2, comp3 . 回答1: Well, there is nothing as of now by Angular CLI to create multiple components. But this can be done trivially in any shell. Run this command into your bash shell - for i in

Angular6: How can I generate a default angular.json file from command line [duplicate]

不想你离开。 提交于 2019-12-24 19:08:14
问题 This question already has answers here : How to generate .angular-cli.json file in Angular Cli? (9 answers) Closed last year . I create a new module using angular 6, that will serve as a package to use in another project. Now, I'm trying to configure the karma and jasmine so I could create unit tests on it. The problem is that I found out that the project does not have any angular.json file. It is possible to generate a default angular.json file from the command line? 回答1: Your best bet is to

How to pass variables in .env file to angular6 environment.ts file

拟墨画扇 提交于 2019-12-24 18:33:15
问题 With angular6 , the global variable process is undefined. I dockerlize my angular app using docker-compose.yml and Dockerfile I create .env file store my secret variables used by docker-compose.yml But, if I get the variables stored in .env file in application code like this: process.env.GITHUB_ACCESS_TOKEN An error will be thrown ERROR in src/app/app.module.ts(41,58): error TS2304: Cannot find name 'process'. src/app/app.module.ts(53,12): error TS2304: Cannot find name 'process'. My

Working with component css files in workspaces in chrome with angular cli 6 project

[亡魂溺海] 提交于 2019-12-21 15:45:54
问题 I'm trying to use Google Chrome workspaces with CSS persistent editing in an Angular 6/7 CLI project. When adding "extractCSS:true" in angular.json configuration and using "--source-map=true" flag I can see the CSS file in the "sources" and "elements" tabs in Chrome, and I can map it to the online CSS file, but when changing the style in the "elements" panel the change is not persistent and is not saved to the file. Is it possible to edit the component CSS files from within Chrome dev tools

ENOENT: no such file or directory for node_modules\jquery\dist\jquery.min.js'

烂漫一生 提交于 2019-12-21 07:10:09
问题 I am not sure what I am doing wrong: I am following the tutorial here, but I keep getting the following error: ENOENT: no such file or directory, open 'C:\Users\andrewkp\Documents\VSCode\Projects\node_modules\jquery\dist\jquery.min.js' Error: ENOENT: no such file or directory, open 'C:\Users\andrewkp\Documents\VSCode\Projects\node_modules\jquery\dist\jquery.min.js' Here is my angular.json file. { "$schema": "./node_modules/@angular/cli/lib/config/schema.json", "version": 1, "newProjectRoot":

ng new has stopped working after updating to Angular 6

橙三吉。 提交于 2019-12-18 05:06:44
问题 Today, I updated my angular cli to the latest version and encountered an error that stops me from creating a new Angular project. Following is the error log that I get after executing ng new app-name : Error: Schematic "ng-new" not found in collection "@schematics/angular". at SchematicEngine.createSchematic (C:\Users\xyz\node_modules\@angular\cli\node_modules\@angular-devkit\schematics\src\engine\engine.js:155:23) at CollectionImpl.createSchematic (C:\Users\xyz\node_modules\@angular\cli\node