angular7

How to use Angular7 (angular material) drag drop between two components

醉酒当歌 提交于 2019-11-27 21:29:54
As recently angular introduced drag and drop in angular material https://material.angular.io/cdk/drag-drop/overview . All examples describes with in a single component. How to use this in two different components, Drag one component item and drop into another component. You may use properties id and cdkDropListConnectedTo to link both lists: Component 1: <div cdkDropList id="list-1" cdkDropListConnectedTo="list-2" (cdkDropListDropped)="drop($event)"> <div *ngFor="let item of list" cdkDrag>{{ item }}</div> </div> Component 2: <div cdkDropList id="list-2" cdkDropListConnectedTo="list-1"

How to uninstall angular packaged library

人走茶凉 提交于 2019-11-27 16:31:52
I have installed example-app.tgz using this command npm install --save example-app.tgz but i can not uninstall this library So how to uninstall this npm package? Not working npm uninstall --save ../example-app.tgz Try this: 1) npm uninstall example-ng-lib-app --save 2) or delete node_modules directory (you might need to kill the app first). remove the example-ng-lib-app from package.json in your root directory. run command: npm install 来源: https://stackoverflow.com/questions/57474470/how-to-uninstall-angular-packaged-library

How to find img tag in angular 7

十年热恋 提交于 2019-11-27 16:31:32
How to find image tag in file .I have tried but not working.I do not know how to convert images for my application. <img src="./assets/images/test1.png" width="250" height="200"> <div class="power"></div> In order to do this, we will need to execute a Node script that will search for any image URL inside the HTML & CSS files using Regex. After that, it will replace these URLs with their Base64 values. First thing, we need to install these NPM packages that will make our life easier: npm install replace-in-file --save-dev npm install datauri --save-dev We will use the first one to find the

Angular 2/4/6/7 - Unit Testing with Router

半腔热情 提交于 2019-11-27 03:55:25
In Angular 2.0.0, I am unit testing a component that uses Router. However I get the 'Supplied parameters do not match any signature of call target.' error. In Visual studio code in spec.ts it is the new Router() that is highlighted in red I really appreciate if someone could let me know what the correct syntax would be? Thanks in advance. My code as follows: spec.ts import { TestBed, async } from '@angular/core/testing'; import { NavToolComponent } from './nav-tool.component'; import { ComponentComm } from '../../shared/component-comm.service'; import { Router } from '@angular/router';

How to use Angular7 (angular material) drag drop between two components

孤人 提交于 2019-11-26 20:38:22
问题 As recently angular introduced drag and drop in angular material https://material.angular.io/cdk/drag-drop/overview . All examples describes with in a single component. How to use this in two different components, Drag one component item and drop into another component. 回答1: You may use properties id and cdkDropListConnectedTo to link both lists: Component 1: <div cdkDropList id="list-1" cdkDropListConnectedTo="list-2" (cdkDropListDropped)="drop($event)"> <div *ngFor="let item of list"

Angular 2/4/6/7 - Unit Testing with Router

断了今生、忘了曾经 提交于 2019-11-26 08:10:29
问题 In Angular 2.0.0, I am unit testing a component that uses Router. However I get the \'Supplied parameters do not match any signature of call target.\' error. In Visual studio code in spec.ts it is the new Router() that is highlighted in red I really appreciate if someone could let me know what the correct syntax would be? Thanks in advance. My code as follows: spec.ts import { TestBed, async } from \'@angular/core/testing\'; import { NavToolComponent } from \'./nav-tool.component\'; import {