angular7

Directive event not being received by the component

大城市里の小女人 提交于 2019-12-11 15:37:21
问题 I have a user search feature with a debounce directive on the search term field: <mat-form-field> <input matInput [(ngModel)]="searchTerm" (appOnDebounce)="search($event)" placeholder="Search..." autocomplete="off"> </mat-form-field> It is supposed to call the method: search(searchTerm: string): void { console.log('Searching for ' + searchTerm); } The directive is implemented as: @Directive({ selector: '[ngModel][appOnDebounce]' }) export class DebounceDirective implements OnInit, OnDestroy {

reactive forms - on Submit, check if there is at least one change in the form and only then call the API

我们两清 提交于 2019-12-11 12:13:32
问题 What I want to achieve is something like this: When the user clicks on Submit button, in the background I need to compare if the state of the form has changed, by state I mean if there is at least one change in the form and only then call the API/Server to save information. If there are not any changes, just show a warning message to the user - "Hey you need to update something!"(console.log() is enough) *I also need to handle this case when the user changes something in the field1, for

Angular 7 Pass Imported Module to Feature Module

随声附和 提交于 2019-12-11 06:56:21
问题 I have a hierarchy of feature modules in an Angular 7 app. It is structured as follows: app admin (UI module imported here) feature1 feature2 public In the admin module, I have imported a UI framework module. My question is, if my modules are imported "upward", should that also mean that the components in feature1 module have access to the UI module, or do I need to import the UI module in each feature module? Do I have fundamental misunderstanding of "child" modules? app.module import {

How to extract the tooltip text within an Angular 7 application using Selenium

流过昼夜 提交于 2019-12-11 06:49:08
问题 I'm trying to read text tooltip in angular7 application via selenium. But get text is returning blank and javascript executor is returning null. Link to the image of the DOM for which I'm not able to find the xpath But get text is returning blank and javascript executor is returning null. This is returning blank driver().get("https://vmware.github.io/clarity/documentation/v0.12/tooltips"); Wait(3000); System.out.println(driver().findElement(By.xpath("(//span[@class='tooltip-content'])[2]"))

Can't resolve all parameters for Application Module: (?). at syntaxError (compiler.js:1021) site:stackoverflow.com

心已入冬 提交于 2019-12-11 06:34:56
问题 After downgrading my Angular project from version 7 to 6 and integrating Angular Universal with the help of @ngToolkit, I'm getting the following error message in the browser console: Can't resolve all parameters for Application Module: (?). at syntaxError (compiler.js:1021) I downgraded the project by simply overwriting the dependencies like described here. As already described the error only occurs in the browser console, while to compilation of the project is completing successfully. 回答1:

Trigger click on specific item under nested loop Angular ngFor

一笑奈何 提交于 2019-12-11 06:24:36
问题 How to target on the specif item under the nested loop <ul #parents *ngFor="let parent of parents"> <li #child *ngFor="let child of parents.childGroup"> {{child.name}} </li> <ul> Ts File Asper my code my target is parents[5].child[0] , but its working as child parents[0].child[0] @ViewChildren('parents') parents : QueryList<ElementRef> @ViewChildren('child') child: QueryList<ElementRef> this.parents.forEach((item, index) => { if (index === 5 ) { (this.child.find( (item , index) => index === 0

How to change HttpClient code after update app to Angular 7

故事扮演 提交于 2019-12-11 06:20:11
问题 I updated Angular to version 7 into my app and I have to change my code a little bit after update but I'm not sure how to do it. This is example of code to change (in previous version of Angular): get(): Observable<MyResponseClass | null> { let url_ = some_url; let options_: any = { method: "get", headers: new Headers({ "Content-Type": "application/json", "Accept": "application/json" }) }; return this.http.request(url_, options_).flatMap((response_: any) => { return this.getResponse(response_

Migration Angular 5 to angular 7

牧云@^-^@ 提交于 2019-12-11 06:08:35
问题 I have migrated from angular 5 to Angular 7. After that I have a problem with my RxJs operation like observable and my @ngrx/store. Here is my error: ERROR in node_modules/@ngrx/store/src/actions_subject.d.ts(2,10): error TS2305: Module C:/Users/AbousyllabaNdiaye/Documents/amundi/ClientAmundiFileIntegration/node_modules/rxjs/BehaviorSubject"' has no exported member 'BehaviorSubject'. node_modules/@ngrx/store/src/reducer_manager.d.ts(2,10): error TS2305: Module '"C:/Users/AbousyllabaNdiaye

I want to decompile an Angular 7 built app

让人想犯罪 __ 提交于 2019-12-11 06:05:13
问题 I built an Angular app using ng build. I have the built version but I accidently deleted my code. Is there any way I can get my code back from my build version? 回答1: Simple answer is NO . But if you really want to do it. Step 1: Deploy the app code in the Dist folder Step 2: Use Google Chrome Developer tools F12 . Step 3: Under debugger tab, look under webpack -> src you will see all typescript files. you can copy and paste the code provided which would help you to at least build the

ngx-chips tag-input-dropdown does not show autosuggest in iPhone

十年热恋 提交于 2019-12-11 05:48:32
问题 I have implemented ngx-chips for an email CC field. It works perfectly in my Android phone using Chrome. But, in iPhone, the autosuggestion does not show up. <div class="required form-group col-md-12 col-sm-12 col-xs-12" > <label class="control-label" for="email.emailCc">CC:</label> <tag-input [(ngModel)]="emailList" [onlyFromAutocomplete]="true" theme='bootstrap'> <tag-input-dropdown [autocompleteObservable]="items" [showDropdownIfEmpty]="true" [dynamicUpdate]="false"> </tag-input-dropdown>