angular

How to implement a facebook pixel in Angular?

故事扮演 提交于 2021-02-11 14:34:01
问题 I need to implement a facebook pixel in an angular proyect. I have the pixel in my index.html from src/index.html <!doctype html> <html lang="en"> <head> ..... </head> <body> <app-root></app-root> <!-- Facebook Pixel Code --> <script> !function(f,b,e,v,n,t,s) {if(f.fbq)return;n=f.fbq=function(){n.callMethod? n.callMethod.apply(n,arguments):n.queue.push(arguments)}; if(!f._fbq)f._fbq=n;n.push=n;n.loaded=!0;n.version='2.0'; n.queue=[];t=b.createElement(e);t.async=!0; t.src=v;s=b

Angular Display Categories & Subcategories in table

拥有回忆 提交于 2021-02-11 14:32:29
问题 I need to display my categories and subcategories in the table. So I have object with categories cats = [ { "id": "1", "parent_id": 'root', "category": "Dress" }, { "id": "17", "parent_id": "1", "category": "Dress 2" }, { "id": "19", "parent_id": "1", "category": "Men" }, { "id": "30", "parent_id": "19", "category": "Shorts 2" }, { "id": "31", "parent_id": "19", "category": "Shorts" } ] OnInit I need to display categories where parent_id is root And on click for example on Dress category I

localStorage is not shared across tabs in the private mode in mobile Safari

烂漫一生 提交于 2021-02-11 14:32:27
问题 I can successfully put stuff into the localStorage in the private mode of mobile Safari. And if I open my web app in 2 different tabs, they don't have access to the same localStorage . By that, I mean if I set a value in the 1st tab, my app in the 2nd tab can't see it. This might happen in other browsers' private mode too but I haven't got a chance to test them. The same code works fine if it is not private mode. The value set by the 1st tab can be accessed by the 2nd tab. Is there an

Change the name of the dropdown menu according to selection in Angular

随声附和 提交于 2021-02-11 14:27:57
问题 There is this dropdown menu in my Angular web-application: <div class="btn-group" dropdown> <button dropdownToggle type="button" class="btn btn-primary dropdown-toggle">NAMEOFDROPDOWN <span class="caret"></span></button> <ul *dropdownMenu class="dropdown-menu" role="menu"> <li role="menuitem"><a class="dropdown-item" routerLink="/first">First</a></li> <li role="menuitem"><a class="dropdown-item" routerLink="/second">Second</a></li> <li role="menuitem"><a class="dropdown-item" routerLink="

Angular Universal set set-cookies in request header

℡╲_俬逩灬. 提交于 2021-02-11 14:22:33
问题 I have anngular Universal SSR application with authentication. I save auth token inside http cookies(set-cookies). Now when I refresh application I see unauthenticated page at first, and after a second it converts to authenticated state. I understand that this happens because Universals renderer server doesn't pass token from cookies to API when rendering page. So how can I force Universal server to render page in authenticated state? 回答1: Angular universal does not transfer cookies when

Sort array and group it with specific value [closed]

只谈情不闲聊 提交于 2021-02-11 14:16:07
问题 Closed. This question needs debugging details. It is not currently accepting answers. Want to improve this question? Update the question so it's on-topic for Stack Overflow. Closed 3 months ago . Improve this question I have an array with a lot of values looking like this : I'm trying to sort the array by grouping every "part" that have the same part_image value and then render the image the value is linked to only 1 single time. I tried using the groupBy function but without success, does

How to set time to be 11:59PM always and disable the time picker using jquery and Angular8

China☆狼群 提交于 2021-02-11 14:15:10
问题 Hi i have used Angular8+ and Jquery to bind calendar into the input field.But irrespective of time zone, i always want to show time to be 11:59PM and disable the Time Picker and set that to 11:59PM by default. Can anyone help me how to make this work. TS: $(".onlyDate").datetimepicker({ format: "L" }); let dat = null; $(".onlyDateTime") .datetimepicker() .on("dp.hide", e => { const date = e.date; let dat = e.date.format("L"); this.Restrictions[this.selectedIndex].datetime = dat.format("MM/DD

I'm Trying to get key value pairs from json data via an external api and display it using angular and typescript. How can I achieve this?

痴心易碎 提交于 2021-02-11 14:12:29
问题 I would like to get each key value pair in the results object from my api to display on my front-end. ie(category, type, difficulty, questions correct_answer) I have the service and components set up correctly and all i need to do is fetch the json and display each pair. The method name is called fetchQuestions as seen below. I was able to successfully get data by just simply calling it the same way I did fetchPeople but the json format is not the same so it's not displaying. I then tried

Getting clicked object from each section of a single stack bar as my stack bar has multiple sections Chart.js

∥☆過路亽.° 提交于 2021-02-11 14:12:21
问题 I have developed a single Stacked bar with three section or data source. I want to know which section I have clicked. This is my code .ts file this.chart = new Chart("Chart1", { type: 'bar', data: { datasets: [{ label: 'Data1', data: [27], }, { label: 'Data2', data: [40], }, { label: 'Data3', data: [12], } ], } }); showData(evt:any){ var data = this.chart.getElementsAtEvent(evt) console.log(data[0]._model); // it prints the value of the property } In the data I am not getting data object

Angular 8 is not loading in IE 11 Browser

五迷三道 提交于 2021-02-11 14:10:36
问题 It is a duplicate question from How do I support Internet Explorer in an Angular 8 application? But I really wondering why none of the solution is not working for me including nested forum sites solutions too.Here are my snippets FYI.have tried a lot and being spending two days for this before posting here. curious to know what i missed and what will be the solution. much appreciated if get the expected solution. package.json "dependencies": { "@angular/animations": "^8.2.3", "@angular/cdk":