angular-cli

Angular CLI: Can't change base in index.html

旧时模样 提交于 2020-01-17 07:54:45
问题 I have Angular 2 app generated by Angular CLI tool. When I change base to any value in index.html : <base href="test"> and build the app (ng build) the resulted index.html has: <base href="/"> So my question is: How can I change base in index.html ? Thanks for any help. 回答1: Use the --base-href option on ng build . https://github.com/angular/angular-cli/wiki/build 来源: https://stackoverflow.com/questions/43830060/angular-cli-cant-change-base-in-index-html

Angular CLI: Can't change base in index.html

与世无争的帅哥 提交于 2020-01-17 07:54:23
问题 I have Angular 2 app generated by Angular CLI tool. When I change base to any value in index.html : <base href="test"> and build the app (ng build) the resulted index.html has: <base href="/"> So my question is: How can I change base in index.html ? Thanks for any help. 回答1: Use the --base-href option on ng build . https://github.com/angular/angular-cli/wiki/build 来源: https://stackoverflow.com/questions/43830060/angular-cli-cant-change-base-in-index-html

Angular-Cli Best way to manage notices

谁都会走 提交于 2020-01-17 07:53:20
问题 I am migrating an old site to my new Angular CLI project and would like to offer my users a notice. "This is a new site! To access your old account, go here..." What I need is a method for the user to close the notice and for it never to return. I am using bootstrap, so the closing part is easy enough... however to persist this I would traditionally use a cookie. What is the best way to do this in Angular, if cookies are the best way, what component should be used? Thanks! 回答1: While cookies

Angular build results in Error: Cannot call a namespace ('v1')?

戏子无情 提交于 2020-01-16 14:20:21
问题 I'm trying this import in an Angular 9 library: import * as v1 from "uuid/v1"; And VS Code does not draw any errors with this, however when I try to build the library I get this error: Error: Cannot call a namespace ('v1') Also this used to work: import v1 from "uuid/v1"; However when doing that I get the error: This module is declared with using ‘export =’, and can only be used with a default import when using the ‘allowSyntheticDefaultImports’ flag. Thoughts? Update I tried this within the

Angular build results in Error: Cannot call a namespace ('v1')?

此生再无相见时 提交于 2020-01-16 14:19:42
问题 I'm trying this import in an Angular 9 library: import * as v1 from "uuid/v1"; And VS Code does not draw any errors with this, however when I try to build the library I get this error: Error: Cannot call a namespace ('v1') Also this used to work: import v1 from "uuid/v1"; However when doing that I get the error: This module is declared with using ‘export =’, and can only be used with a default import when using the ‘allowSyntheticDefaultImports’ flag. Thoughts? Update I tried this within the

ng add @angular/fire 'Server Error. certificate has expired'

本小妞迷上赌 提交于 2020-01-16 08:36:07
问题 ng add @angular/fire .... audited 23085 packages in 14.519s found 0 vulnerabilities Server Error. certificate has expired Using last versions : Angular CLI: 8.3.21 Node: 10.16.0 Angular: 8.2.14 firebase-tools : 7.11.0 Already tried logout and login to firebase again but it doesn't solve the problem 回答1: I was trying to add @angular/fire to my project just to deploy it to firebase but it seems like there is a problem with "ng" commands when using firebase. The only way i found to resolve this

ng add @angular/fire 'Server Error. certificate has expired'

≡放荡痞女 提交于 2020-01-16 08:36:06
问题 ng add @angular/fire .... audited 23085 packages in 14.519s found 0 vulnerabilities Server Error. certificate has expired Using last versions : Angular CLI: 8.3.21 Node: 10.16.0 Angular: 8.2.14 firebase-tools : 7.11.0 Already tried logout and login to firebase again but it doesn't solve the problem 回答1: I was trying to add @angular/fire to my project just to deploy it to firebase but it seems like there is a problem with "ng" commands when using firebase. The only way i found to resolve this

Strange ERROR in HostResourceLoader: when run ng build, ng build --prod or ng serve

て烟熏妆下的殇ゞ 提交于 2020-01-15 09:30:03
问题 I'm creating an app with angular 6 but I facing a strange error when I try to run any build command: 1- ng build 2- ng build --prod 3- ng build serve Error:ERROR in HostResourceLoader: loader(F:/Spark/Spark Apps Development/doPayroll Front-End/doPayroll Front-End/src/app/getstarted/getstarted.component.html) returned a Promise Also, the error show on the following image It's strange that the error solve and the app run when I press ctrl+s to any ts file, it resume compiling and run

ngx-datatable: How to display value of a property on a object in a row

和自甴很熟 提交于 2020-01-15 03:23:27
问题 I am struggling with something basic in ngx-datatable. In an angular-cli application I am binding an Array with 3 elements to the table and get displayed 3 (empty) rows. When I click a row I correctly get the object i have bound the row. I have used this http://swimlane.github.io/ngx-datatable/#single-selection as a starting point This is how it looks in the UI. The value of property StockName should be printed in each row. But it doesn't, but the value of a select row is correctly being

NG Build fails in Azure Pipelines with NPM error 134

限于喜欢 提交于 2020-01-14 13:36:13
问题 Approx 50% of my hosted builds are failing with npm error 134. I am building the same commit with the same build definition using hosted vs2017. I am building an Angular Application using the Angular CLI. The npm task calls 'run build' which is defined as "ng build --prod" in my package.json. Both a successful build and failed build are using npm task version 1.1.49 and npm verion 6.8. This leads me to believe it is something related to the hosted environment. The hosted vs2017 and vs2019