angular6

Angular 6 router link issue in the same page

浪子不回头ぞ 提交于 2019-12-08 07:53:32
问题 I have two links: ['/productlist',1000] ['/productlist',1001] These two links are on the same page. If I click on any link for the first time. It is redirecting to the page, but if I click on the other link it is not working. component.html code <a class="dropdown-item" (click)="GetProductList(subitem.SubCategoryID)"> <i class="mdi mdi-chevron-right" aria-hidden="true"></i> {{ subitem.SubCategoryName}} </a> GetProductList(SubCategoryID){ this.router.navigate(['/productlist',SubCategoryID]); }

Angular 6 - Formatting Export Excel Sheet

牧云@^-^@ 提交于 2019-12-08 05:46:11
问题 i would like to apply styling in excel sheet to represent the data. Here is my code import { Injectable } from '@angular/core'; import * as FileSaver from 'file-saver'; import * as XLSX from 'xlsx'; const EXCEL_TYPE = 'application/vnd.openxmlformats- officedocument.spreadsheetml.sheet;charset=UTF-8'; const EXCEL_EXTENSION = '.xlsx'; @Injectable() export class ExcelService { constructor() { } public exportAsExcelFile(json: any[], excelFileName: string): void { var aoa = this.create2DArray(json

cytoscape.js and Angular6

梦想与她 提交于 2019-12-08 05:27:14
问题 I want to import cytoscape.js library in my angular project, but I don't know how to do it. As far as I know, there is no official cytoscape module for angular, is there any way to import cytoscape manually? 回答1: UPDATE: Please see the answer of D.C. Joo, this should be the accepted answer. Actually, it's no problem to import JS libraries in Angular, thats how I do it using npm and Angular6: Run npm install cytoscape Download Cytoscape from https://github.com/cytoscape/cytoscape.js/blob

Internet explorer & Angular 6 ERROR Error: Uncaught (in promise): Error: Loading chunk

佐手、 提交于 2019-12-08 05:04:20
问题 I am getting issue while using angular 6 and IE 11, app is working fine in chrome & another browser but in internet explorer, i am getting this ERROR Error: Uncaught (in promise): Error: Loading chunk default~app-xxxxx~eb5ba6d4 failed. (missing: http://localhost:4200/default~app-xxxx.js) Error: Loading chunk default~app-xxxx~eb5ba6d4 failed. (missing: http://localhost:4200/default~app-xxxx~eb5ba6d4.js) Project details Angular CLI: 6.2.3 Node: 8.12.0 OS: win32 x64 Angular: ... Package Version

Ionic 4 + Angular 6 PWA Styles not working / broken

可紊 提交于 2019-12-08 04:30:21
问题 Hope someone can help me here, I have an Ionic 4 app using Angular 6 pwa. I have followed the steps in this post to get it working https://www.joshmorony.com/create-a-pwa-with-angular-service-workers-in-ionic-4/ All the steps complete fine and also the package builds and runs correctly without errors. However all my control specific styles are missing e.g my-controll.component.scss app-my-contol { ion-content { background-color: var(--light-gray-lightest); } .my-class { padding:0; list-style:

Angular 6 - http error status code 0 instead of 401, 400… any except 200

荒凉一梦 提交于 2019-12-08 04:00:27
问题 I know similar solution already given by many enthusiastic over here, Link-1 Link-2 But I already configured CORS . so I am using NGiNX server and see following configuration in order to satisfied CORS issue... if ($request_method = 'OPTIONS') { add_header 'Access-Control-Allow-Origin' '*'; add_header 'Access-Control-Allow-Credentials' 'true'; add_header 'Access-Control-Allow-Methods' 'GET, POST, OPTIONS'; add_header 'Access-Control-Allow-Headers' 'DNT,x-auth-token,Keep-Alive,User-Agent,X

custom styling of specific component getting applied to all the components in angular 6

送分小仙女□ 提交于 2019-12-08 03:58:20
问题 ui grid, I am trying to apply custom styling to specific component(i want to change font size for that specific component), but when i write css code in that particular components css file, and after loading that component that style is getting applied to all the other components also following is the code in css file .k-grid td { font-size: 10px !important; } .k-grid tr { font-size: 10px; } code in ts file @Component({ selector: 'app-work-request-queue-child', templateUrl: './work-request

After update to Angular 6 [WDS] Disconnected on IE after load

元气小坏坏 提交于 2019-12-08 03:39:56
问题 I updated my Angular Project from 5 to 6. But now I have issues with the Internet Explorer 11. Every time I try to load the live dev server on localhost:4200 the login page renders but immediatly disconnects from the live dev server. All other Browsers work fine, no errors on the console (tried with Edge, Firefox and Chrome) My pollyfills look like this: /** * This file includes polyfills needed by Angular and is loaded before the app. * You can add your own extra polyfills to this file. * *

Angular 6 illegal operation on a directory, open '/Users/<username>/.npm-global/lib/node_modules/

拜拜、爱过 提交于 2019-12-08 03:29:32
问题 I followed a tutorial so that I would not have to use sudo before everything that I do with npm install tutorial to set npm global config to a new directory No matter what I do, now it everything tries to install to this new ~/.npm-global directory. I have deleted it several times: sudo rm -R .npm-global/ I tried to override the settings: sudo npm set globalconfig "" sudo npm set globalignorefile "" But no matter what, if I try to run something like: sudo npm install -g @angular/cli I still

Modify angular cli build to run custom script

房东的猫 提交于 2019-12-08 03:06:32
问题 I have a custom node script that generates a pseudo language file, in older angular.js projects I used a gulp task to run the script as part of the build process. Is there a way to modify angular-cli to run the script on ng build/ng serve? I know I can use npm run-scripts to run it and then run the ng command but just wondering if there is a way to do with angular-cli directly? 来源: https://stackoverflow.com/questions/50908092/modify-angular-cli-build-to-run-custom-script