angular

kolkov/ngx-gallery not displaying Image

久未见 提交于 2021-02-11 12:46:00
问题 I'm new to Angular, I'm trying to add Image gallery in my project. Image gallery works if use the hard coded data in this.galleryImages[] but when I pass my subscribe data into this.galleryImages[] it not showing anything. Note I can see my data in console. Its not only binding in Ngx gallery. This is the link form ngx-gallery repo: https://www.npmjs.com/package/@kolkov/ngx-gallery This is the image showing my gallery but only showing when I input hardcoded data not the data coming from my

Add a typescript library to angular

时间秒杀一切 提交于 2021-02-11 12:41:50
问题 I installed a text editor called Jodit and I'm having some issues trying to integrate it into my angular application. In order, I did: npm install --save jodit Added in angular.json build-options-sripts "node_modules/jodit/build/jodit.min.js" Added in angular.json build-options-styles "node_modules/jodit/build/jodit.min.css" Here is my component: import * as jodit from 'jodit'; @Component({ selector: 'app-test', styleUrls: ['./test.component.scss'], template: ` <textarea id="test" name=

Angular 7 Guard redirection only works on double click

不打扰是莪最后的温柔 提交于 2021-02-11 12:41:50
问题 THe problem is that I've implemented a Guard, meant to work with a specific directory . It should return true if the role of the current username equals 2 . If it doesn't then it shouldnt redirect. THis is my app-routing-module.ts file , the problem is in the 'userlist' path, were we implement the [RoleGuard] canActivate import { NgModule } from '@angular/core'; import { CommonModule } from '@angular/common'; import { Routes, RouterModule, Router } from '@angular/router'; import {

Angular 7 Guard redirection only works on double click

独自空忆成欢 提交于 2021-02-11 12:41:21
问题 THe problem is that I've implemented a Guard, meant to work with a specific directory . It should return true if the role of the current username equals 2 . If it doesn't then it shouldnt redirect. THis is my app-routing-module.ts file , the problem is in the 'userlist' path, were we implement the [RoleGuard] canActivate import { NgModule } from '@angular/core'; import { CommonModule } from '@angular/common'; import { Routes, RouterModule, Router } from '@angular/router'; import {

How to make Angular watch multiple libraries for changes and recompile when needed

邮差的信 提交于 2021-02-11 12:40:44
问题 This question is much the same as Make angular app watch for libraries changes and update itself. But, that question was never successfully answered as applies to the use of multiple libraries. I also reviewed Angular library and live reload and surveyed the answers and links from both questions. My app is using two libraries: lib-1 and lib-2 . When those files are edited, they are ignored and the app does not recompile. To see changes, I have to restart the server which really slows things

How to make Angular watch multiple libraries for changes and recompile when needed

◇◆丶佛笑我妖孽 提交于 2021-02-11 12:39:13
问题 This question is much the same as Make angular app watch for libraries changes and update itself. But, that question was never successfully answered as applies to the use of multiple libraries. I also reviewed Angular library and live reload and surveyed the answers and links from both questions. My app is using two libraries: lib-1 and lib-2 . When those files are edited, they are ignored and the app does not recompile. To see changes, I have to restart the server which really slows things

How to write a Jasmine test for printer function

|▌冷眼眸甩不掉的悲伤 提交于 2021-02-11 12:36:43
问题 I am trying to write a Jasmine test for the following print function: printContent( contentName: string ) { this._console.Information( `${this.codeName}.printContent: ${contentName}`) let printContents = document.getElementById( contentName ).innerHTML; const windowPrint = window.open('', '', 'left=0,top=0,width=925,height=1400,toolbar=0,scrollbars=0,status=0'); windowPrint.document.write(printContents); windowPrint.document.close(); windowPrint.focus(); windowPrint.print(); windowPrint.close

Image Slider / carousel not render while user move from one page to other - Angular 6

梦想与她 提交于 2021-02-11 12:33:40
问题 There are multiple pages (Home & Product detail page) in my application and each page has carousel with multiple images . When i browse application home page whole page is loaded and all js & carousel js working fine and carousel initialized without any error . But when i clicks on any product detail page then angular updates center part of page while header & footer remains same . Issue - carousel is not initialized at product detail page and all images display individually instead of

Keep cursor grabbing between list. @angluar/cdk/drag-drop

荒凉一梦 提交于 2021-02-11 12:32:19
问题 I have this example in stackblitz. I use @angular/cdk/drag-drop in my project. I try to change the cursor to cursor:grabb and cursor:grabbing when the cursor is up an element and when I drag a picked element. I use this line: .example-box:active { cursor:grabbing } But its not working. What's I need to do? 回答1: I know it's has been a while, but I found a solution to the issue! first add this global CSS: body.inheritCursors * { cursor: inherit !important; } and to your cdkDrag element add

The theme-color meta tag did not contain a valid CSS color

岁酱吖の 提交于 2021-02-11 12:29:31
问题 I have a PWA app and when I do an Audit using the Chrome development tools, I get this message saying the CSS color code is invalid: Failures: The theme-color meta tag did not contain a valid CSS color. I beg to differ. It's a valid CSS color code. Also the Google dev page says: Lighthouse does not test whether the values are valid CSS color values. but that's contrary to what the audit complains about. I searched for this message and there's very little, or should I say, next to nothing,