angular7

How to apply pipe to value in RouterLink?

╄→尐↘猪︶ㄣ 提交于 2021-02-05 11:48:23
问题 I have the following route in Angular 7: <a [routerLink]="['/categories', {{ category.name | slugify }}, category.id]">{{category.name}}</a> The problem is with applying the pipe slugify within the routerlink . How can I apply a pipe to a value inside routerLink ? 回答1: Try removing the curly brackets like this: <a [routerLink]="['/categories', category.name | slugify, category.id]">{{category.name}}</a> You don't need them there because you are using property binding which is already

Conditionally applying css to mat form field

给你一囗甜甜゛ 提交于 2021-01-29 13:21:24
问题 I am working on an angular application and I am using mat form fields in it. For changing color of botttom border of mat form field I am using mat-form-field-ripple css which is inbuilt for mat form field. CSS is as follows. .mat-form-field-ripple { background-color: #f9c940!important; } When I use this CSS, it automatically gets applied to all form fields. I have to apply #f9c940 color in mat-form-filed-ripple in when one condition is true and a different color when another condition is true

Where do I add firebase.initializeApp() in my angular 7 project?

我与影子孤独终老i 提交于 2021-01-29 10:09:05
问题 Im trying to deploy my angular app to firebase hosting and I get the following error in console: Uncaught FirebaseError: "projectId" not provided in firebase.initializeApp. I have this in my app.module.ts: export class AppModule { constructor(private afs: AngularFirestore) { afs.firestore.settings({ timestampsInSnapshots: true, }); afs.firestore.enablePersistence(); firebase.initializeApp(environment.firebase); } } Where exactly should I add the initializeApp command in app.module? 回答1: There

How can i resolve the error “access is denied” in IE browsers when downloading a PDF from my angular7 application?

安稳与你 提交于 2021-01-29 10:02:53
问题 In my angular 7 application I have an API, when called, will download a PDF. Here is my methods for getting the PDF: getPdf() { const payload = { applicantId: this.idHeader, codes: this.codeHeader + ':0', genderType: this.gender, data: this.data } this.service.getPdfConfirmationView(payload).subscribe((pdfResponse: any) => { let dataType = 'application/pdf'; let binaryData = []; binaryData.push(pdfResponse); let downloadLink = document.createElement('a'); downloadLink.href = window.URL

post request with form-data from angular to spring

末鹿安然 提交于 2021-01-29 06:48:48
问题 i am trying to send a post request to my spring rest api using angular and its http library. currently in post-man (sucessfully) i am sending the data in this way: The format is form-data The key is reqData(mandatory) The Value is json(mandatory) how to send the data in the same way via angular? currently, this is how my data looks like: onSignIn(form: NgForm) { const email = form.value.email; const password = form.value.password; const reqData = { 'app_uname': email, 'app_pass': password };

Image not change dynamically when update in angular 7

情到浓时终转凉″ 提交于 2021-01-29 05:39:02
问题 Why is image not changing when updating it.I'm showing images set.Images data stored in an array.When update it,it's all the data will change,but image is preview old one.I checked it's path,it also the updated url.I can't understand why it's not changing.If I copy array data to const variable and after that array assign to null,then after again assign array to const variable.After that refresh the page,then only it's show the updated image. I'm storing images data inside my database.I want

Difference between “highcharts-angular” and “angular-highcharts” node modules (for Angular v7)

时光怂恿深爱的人放手 提交于 2021-01-29 05:29:29
问题 My application will be Angular v7 and Highcharts (latest version) I'm wondering what's the difference between the below 2 node modules, each is listed on the HighCharts tutorial page, and they look the same: Node module: highcharts-angular Node module: angular7-highcharts I've a simple example working with "highcharts-angular" but unsure which I should be using. Any thoughts/guidance would be great. Thanks Ro 回答1: As you can read in the posted articles highcharts-angular is Highcharts Angular

angular 7 build app - replace assets url with real url

試著忘記壹切 提交于 2021-01-29 05:21:12
问题 In an Angular 7 app i have different assets, images, fonts etc. All are located in src/assets/images or src/assets/fonts, etc I my files i use them like this: <img src="/assets/images/img.png"> angular.json look like this: ..... "assets": [ "src/favicon.ico", "src/assets" ] ..... When building I use: ng build --prod --build-optimizer --deploy-url=https://cdn.domain.com This will replace all the reference to assets resource from this: <img src="/assets/images/img.png"> to this: <img src="https

“viewFullscreen” menu item is not showing in the context menu of highcharts 6.2.0

我与影子孤独终老i 提交于 2021-01-29 01:41:04
问题 I have a highchart line chart which currently displayed in bootstrap 4 card. I want it to displayed full screen, which I'm currently aware that highchart 6.2.0 has option to enabled exporting file, so that I can use the exporting context menu. so, I enabled them but "showFullscreen" option not showing in the exporting context menu. I imported highchart and exporting module to the component. in the documentation highchart guys says that I have to include viewFullscreen as string to the

“viewFullscreen” menu item is not showing in the context menu of highcharts 6.2.0

末鹿安然 提交于 2021-01-29 01:40:13
问题 I have a highchart line chart which currently displayed in bootstrap 4 card. I want it to displayed full screen, which I'm currently aware that highchart 6.2.0 has option to enabled exporting file, so that I can use the exporting context menu. so, I enabled them but "showFullscreen" option not showing in the exporting context menu. I imported highchart and exporting module to the component. in the documentation highchart guys says that I have to include viewFullscreen as string to the