angular

Angular 9 ng new stuck at installing packages

萝らか妹 提交于 2021-02-10 06:18:52
问题 I have just installed the node version 12.16.1 the LTS and angular cli version 9.0.3. At the time of creating new project with cli all files in root folder are generating but it is stuck at the part of installing node packages. Is anybody facing the same issue? Please help how can we resolve it. 回答1: Every time you create a new project the angular suppose to download huge chunks of file of size around 500mb, all the time that is been taken is actually the time taken to download those file in

Font awesome icon not displaying inside ag-grid cell in Angular 8

这一生的挚爱 提交于 2021-02-10 06:17:49
问题 I'm trying to learn Angular so following guides on installing and using ag-grid and Font Awesome, but I can't get an fa-icon to display inside an ag-grid cell using the cellRenderer. If I use the same icon HTML outside of the grid, it displays correctly. And if I put something like a link in place of the icon in the cell, it displays correctly. Here is my code: component.ts import { Component } from '@angular/core' import { faUserEdit } from '@fortawesome/free-solid-svg-icons'; @Component({

Font awesome icon not displaying inside ag-grid cell in Angular 8

限于喜欢 提交于 2021-02-10 06:16:41
问题 I'm trying to learn Angular so following guides on installing and using ag-grid and Font Awesome, but I can't get an fa-icon to display inside an ag-grid cell using the cellRenderer. If I use the same icon HTML outside of the grid, it displays correctly. And if I put something like a link in place of the icon in the cell, it displays correctly. Here is my code: component.ts import { Component } from '@angular/core' import { faUserEdit } from '@fortawesome/free-solid-svg-icons'; @Component({

Can't set up routing to a named outlet in Angular

自古美人都是妖i 提交于 2021-02-10 05:31:08
问题 I have three named router outlets as shown below. ... <router-outlet name="menus"><router-outlet> <router-outlet><router-outlet> <router-outlet name="footer"><router-outlet> ... In the markup I want to route the first one, menus , to a component with certain submenu junk in it as shown in the docs. <ul *ngFor="let main of menus;" routerLink="[{outlets:{menus:[{{main.link}}]}}]" class="nav-items">{{main.header}} The error I'm getting says that: Error: Cannot match any routes. URL Segment: '%5B

Angular: pass parameter to another component

你说的曾经没有我的故事 提交于 2021-02-10 05:31:07
问题 I'm stuck with Angular2, I would like to pass parameters from a Products page (eg: product ids) to a Payment page , here is what I tried so far: payment.html : Message: {{message}} <page-products></page-products> payment.ts : import { Component, ViewChild, AfterViewInit} from '@angular/core'; import { ProductsPage } from "../../products/products"; @IonicPage() @Component({ selector: 'page-payment', templateUrl: 'payment.html' }) export class PaymentPage implements AfterViewInit { @ViewChild

How to watch service variable in Angular 6

蹲街弑〆低调 提交于 2021-02-10 05:20:08
问题 ive been trying to make Angular update the service variable "open_popup" for days with no luck. TLDR; What I'm trying to do, is whenever the variable "open_popup" changes, make it change on the component too also be able to change the service variable from a component function. This is what I've tried so far. app/src/app/audience-creator/shared/audience-creator.service.ts import { Injectable } from "@angular/core"; import {Observable} from "rxjs/index"; import { of } from "rxjs/index";

How to watch service variable in Angular 6

孤街浪徒 提交于 2021-02-10 05:20:07
问题 ive been trying to make Angular update the service variable "open_popup" for days with no luck. TLDR; What I'm trying to do, is whenever the variable "open_popup" changes, make it change on the component too also be able to change the service variable from a component function. This is what I've tried so far. app/src/app/audience-creator/shared/audience-creator.service.ts import { Injectable } from "@angular/core"; import {Observable} from "rxjs/index"; import { of } from "rxjs/index";

sending state with router gets undefined

时光怂恿深爱的人放手 提交于 2021-02-10 05:15:05
问题 I have a component that uses router to navigate to another component with a boolean variable like this this.router.navigate(['/consume/course/' + this.id, {state: { isFirst }} ], { replaceUrl: true }); in the other component I am trying to get this variable from the router like this const isFirst = this.router.getCurrentNavigation().extras.state.isFirst; but I get this error: Cannot read property 'extras' of null Why do I have null for the current navigation? Also, this is my routing module

Angular 9.0 - FormGroup and FormArray - remove row from table

北战南征 提交于 2021-02-10 05:14:34
问题 I've tried trying to remove a row using a button click, but it doesn't work and I'm not so sure what can I do to solve this issue. Initial json displayed is: { "list": [ { "description": null, "status": false } ] } When I click the Remove button, the json displayed will become: { "list": [] } AND the selected row is not removed at all. Here's the codes below. todo-list.component.ts todoListForm: FormGroup; constructor(private toDoService: TodoService, private formBuilder: FormBuilder) { this

How to create a “submenu” in a dynamic dropdown list with typescript and angular?

扶醉桌前 提交于 2021-02-10 05:14:33
问题 This is how I have created a dynamic dropdown list: .html <label> Move to </label> <select [(ngModel)] = "mSelectedCategoryNameMoveTo" (click) = "onMoveToSelected()" [disabled] = "mflagDisableMoveTo" > <option *ngFor = "let category of categories" [ngValue] = "category.name" > {{category.name}} </option> </select> Here the list categories is coming from .ts file. All the variables and the functions are defined in the corresponding .ts file. The category structure .ts is as follows: export