angular-cli

Angular5 PWA doesn't refresh (Service Workers)

一世执手 提交于 2020-05-15 04:46:25
问题 I'm developing an app with angular5, using service workers via the ng-cli, but I realized that after the first time the app shell loads, it doesn't refresh. How can I push new file versions to my app after build it with ng build ?. I could directly rewrite the sw.js manually, but as it is generated via the cli, I don't like to affect anything I don't know what is for. I'm looking for this answer all day, but as service workers are new for the 1.6 version of the ng-cli, I have not found any. I

How set proxy headers in proxy.config.json file for angularcli project

放肆的年华 提交于 2020-05-14 17:49:49
问题 I'm trying to set proxy headers for angularcli . Here's what I have so far in my proxy.config.json file: "/api": { "target": "https://applications.str.coni.com/api", "secure": false, "logLevel": "debug" But I haven't had any luck so far, perhaps I'm missing something (probably in another file). Any suggestions would be much appreciated. 回答1: Angular-cli uses http-proxy-middleware https://github.com/chimurai/http-proxy-middleware there is an option called headers that you can use: https:/

Integrate node-sass-json-importer into an Angular CLI application

[亡魂溺海] 提交于 2020-05-14 15:54:11
问题 Trying to add the node-sass-json-importer into an Angular CLI application. I was using version 1.0.0-beta.17 of the CLI, but haven't been able to figure it out using the current version 1.2 either. After installing it via yarn I don't know where it should be setup in the application configuration. Has anyone successfully integrated this into their application? The only answer I could find regarding this is for applications using Webpack, but not for the Angular CLI. 回答1: Solved this by

Angular 5 Upgrade NullInjectorError: No provider for InjectionToken LocaleId

纵然是瞬间 提交于 2020-05-14 07:44:08
问题 I have an Angular 4 app that I have upgraded to Angular 5 with CLI 1.5.4. I also have a shared library using npm link. After upgrading I had to add this to my tsconfig.app.json to get the CLI building again: "include": [ "./**/*.ts", "../node_modules/my-lib/src/**/*.ts", "../node_modules/my-lib/index.ts", "../node_modules/my-lib/ng2-icad-cf.ts" ], After a successful build, I am presented with the following error when visiting localhost:4200 NullInjectorError: No provider for InjectionToken

Angular CLI Error path and code EEXIST

微笑、不失礼 提交于 2020-05-13 03:55:46
问题 I first installed npm and made sure it was up to date. Then I tried installing angular but I was faced with errors ~ kode$ sudo npm install -g @angular/cli Password: npm WARN ajv-keywords@3.1.0 requires a peer of ajv@^6.0.0 but none is installed. You must install peer dependencies yourself. npm ERR! path /usr/local/bin/ng npm ERR! code EEXIST npm ERR! Refusing to delete /usr/local/bin/ng: ../lib/node_modules/angular-cli/bin/ng symlink target is not controlled by npm /usr/local/bin npm ERR!

Angular CLI Error path and code EEXIST

守給你的承諾、 提交于 2020-05-13 03:55:38
问题 I first installed npm and made sure it was up to date. Then I tried installing angular but I was faced with errors ~ kode$ sudo npm install -g @angular/cli Password: npm WARN ajv-keywords@3.1.0 requires a peer of ajv@^6.0.0 but none is installed. You must install peer dependencies yourself. npm ERR! path /usr/local/bin/ng npm ERR! code EEXIST npm ERR! Refusing to delete /usr/local/bin/ng: ../lib/node_modules/angular-cli/bin/ng symlink target is not controlled by npm /usr/local/bin npm ERR!

npm throws EACCES error on installation of Angular CLI

ε祈祈猫儿з 提交于 2020-05-12 15:44:41
问题 I am unable to install Angular Cli globally through npm. I keep getting this error when I run npm install -g @angular/cli on macOS: npm ERR! node v6.9.2 npm ERR! npm v3.10.9 npm ERR! path /usr/local/lib/node_modules npm ERR! code EACCES npm ERR! errno -13 npm ERR! syscall access npm ERR! Error: EACCES: permission denied, access '/usr/local/lib/node_modules' npm ERR! at Error (native) npm ERR! { Error: EACCES: permission denied, access '/usr/local/lib/node_modules' npm ERR! at Error (native)

Difference between tsconfig.json and tsconfig.app.json files in Angular

南楼画角 提交于 2020-05-11 03:57:38
问题 I'm a newbie in Angular. I used angular-cli to learn about angular and I found the files tsconfig.json and tsconfig.app.json . Both of these are typescript related and I found this link useful. But why two such files has been used? Why can't the configurations in these two files be combined in one file? Please help me figure this out. 回答1: there is nothing that prevents you from getting rid of the tsconfig.app.json . it's just an additional config file that allows you to adjust your

Difference between tsconfig.json and tsconfig.app.json files in Angular

一笑奈何 提交于 2020-05-11 03:57:30
问题 I'm a newbie in Angular. I used angular-cli to learn about angular and I found the files tsconfig.json and tsconfig.app.json . Both of these are typescript related and I found this link useful. But why two such files has been used? Why can't the configurations in these two files be combined in one file? Please help me figure this out. 回答1: there is nothing that prevents you from getting rid of the tsconfig.app.json . it's just an additional config file that allows you to adjust your

'L' refer to a UMD global - compilation error

陌路散爱 提交于 2020-05-10 07:28:50
问题 I am using in my project the plugin ngx-leaflet, and angular-cli. I am trying to use leaflet as described in the doc, for example : The problem is when I'm trying to compile I got the following error : Compiled with : ng serve --aot Context here : I did try to import L in different ways using : import { LeafletModule } from '@asymmetrik/ngx-leaflet'; But I cannot find anything in documentation nor the github. I did remove the module atm to compile, but I need a workaround. Here is the package