angular6

Create inputs as array in angular form

寵の児 提交于 2019-12-23 05:13:12
问题 Tried my level best please help me out.. I am making an angular dynamic form with a form splitting into total of three parts in which the two parts were made already. Now I am making part three which will be generated by selecting an option from dropdown... Even those part also is done... But I am unable to make a form array in it... As I am new in angular please help me. HTML: Form part 3 will be here which will be array <select multiple (change)="changeEvent($event)"> <option *ngFor="let

Invalid path in Angular library

对着背影说爱祢 提交于 2019-12-23 04:34:51
问题 I am using Angular library and have the following folder structure: coollibrary - components - my.component.ts - services - my.service.ts public_api.ts In public_api, I export the component and service and make the library build. After that I can import the necessary things in my project using import { MyComponent } from 'coollibrary'; but I can not use the following path: import { MyComponent } from 'coollibrary/components' Can I somehow achieve this behavior? I generate library with

Angular 6 : DevTools failed to parse SourceMap: https://example.com/ngsw_worker.es6.js.map

谁说胖子不能爱 提交于 2019-12-23 03:47:05
问题 I converted my angular 6 application to PWA using the Angular CLI (ng add @angular/pwa). I only have one project in my directory and so I ran this command without specifying project name. After deployment, the service worker registers - and everything seems to be in order expect i get the following error in google chrome console: DevTools failed to parse SourceMap: https://example.com/ngsw_worker.es6.js.map What does this error mean? And how can it be fixed/avoided? Thank you! 回答1: Go to

Cannot resolve tsconfig paths

帅比萌擦擦* 提交于 2019-12-23 02:52:33
问题 My Angular 6 project with TypeScript version "2.7.2" has tsconfig.json as { "compileOnSave": false, "compilerOptions": { "baseUrl": "./src", "outDir": "./dist/out-tsc", "sourceMap": true, "declaration": false, "moduleResolution": "node", "emitDecoratorMetadata": true, "experimentalDecorators": true, "target": "es5", "typeRoots": [ "node_modules/@types" ], "lib": [ "es2017", "dom" ] }, "paths":{ "@services/*": ["app/services/*"] } } I tried importing a service using the above path import {

how can I install correctly ngx-recaptcha on my project?

断了今生、忘了曾经 提交于 2019-12-23 00:50:35
问题 I'm doing a form to register an Ad, but when I installed the recaptcha it doesn't works Ok, I couldn't reset it or reload it, etc, I've followed the tutorial to the letter and nothing, this is the page, meanly enter link description here <ngx-recaptcha2 #captchaElem [siteKey]="siteKey" (reset)="handleReset()" (expire)="handleExpire()" (load)="handleLoad()" (success)="handleSuccess($event)" [useGlobalDomain]="false" [size]="size" [hl]="lang" [theme]="theme" [type]="type" formControlName=

NgRX Effect for downloading media file and dispatching progress; how to deal with the stream and throttling

只愿长相守 提交于 2019-12-22 18:05:02
问题 I am struggling a bit with understanding and applying @Effects for my episode Download option. I got some help in another question and this is my latest concoction. Quick overview: User clicks download which dispatches a DOWNLOAD_EPISODE action which is captured in the first Effect. The download call returns a stream of HttpEvents and a final HttpResponse. During the event.type === 3 I want to report download progress. When event.type === 4 the body has arrived and I can call the success

Distance Calculation in Angular

断了今生、忘了曾经 提交于 2019-12-22 18:03:08
问题 I am making a distance calculation application using angular which has, Html: <form [formGroup]="form" *ngIf="showForm"> <div formArrayName="distance" > <table> <thead> <th> From Distance (Km) </th> <th> To Distance (Km) </th> <th> Fare Per Kilometer </th> </thead> <tbody> <tr *ngFor="let item of form.get('distance').controls; let i = index" [formGroupName]="i"> <td> <input type="number" placeholder="From" formControlName="from"> </td> <td> <input type="number" placeholder="To"

Angular 6 project displays 404 error after refresh

心不动则不痛 提交于 2019-12-22 13:58:17
问题 Refreshing my angular page gives me a 404 server error, it does the same if I manually navigate to directory in the search bar. I am hosting through an IIS Server. This problem only occurs whenever I build my angular project with ng build --prod and then upload it to my web server. Many people say you should use the hash method, but I don't want a hash to be displayed inside my url, and it's a very old method. Some people also say I should change my <base> tag in my <head> , but that hasn't

Passing for variable to ng-content

↘锁芯ラ 提交于 2019-12-22 10:08:05
问题 How do I pass an ngFor variable to the ng-content template. Example, the containing-component: <ul> <li *ngFor="let item of itemsArray"> <ng-content></ng-content> </li> </ul> The nested content-component: <div> <span *ngIf="item.type_one"></span> <span *ngIf="item.type_two"></span> </div> Example, both: <containing-component> <content-component> </content-component> </containing-component> 回答1: You can not use ng-content as dynamic template. Use ng-template instead <ul> <li *ngFor="let item

How to downgrade angular7 to angular6

半腔热情 提交于 2019-12-22 09:47:49
问题 I have tried to downgrade angular 7 to angular 6 by running the following npm commands: npm uninstall -g angular-cli npm cache clean npm install -g angular-cli@6.1.1 However angular/cli 7 version is still displaying in my package.json file. I need help to downgrade angular7 to angular6 . 回答1: You need to set the version numbers in your package.json for (at least) this packages "@angular/animations": "^7.0.0", "@angular/cdk": "7.3.3", "@angular/common": "^7.0.0", "@angular/compiler": "7.2.6",