Lazy module can not be found although path seems correct

Issue link: https://play.nativescript.org/?template=play-ng&id=Annyna&v=4 error: ERROR Error: Uncaught (in promise): Error: com.tns.NativeScriptException: Failed to find module: “./TrainingUnit”, relative to: app/trainingunit/list/ Its odd that the module name in the error message is: “./TrainingUnit” The module file name is: trainingunit.module The module class

Continue reading

ng-bootstrap Change default color of radio button

Issue I am new to ng-bootstrap. Default color of radio buttons in ng-bootsrap is blue. I need default color as yellow and on click it should be green. buttons-radio.html <div class=”btn-group btn-group-toggle” ngbRadioGroup name=”radioBasic” [(ngModel)]=”model”> <label ngbButtonLabel class=”btn-primary”> <input ngbButton

Continue reading

Conditional reset method "if disable ignore not disable reset" angular

Issue <div> <div> <label>Name</label> <input type="text" [(ngModel)]="name" [disabled]="editData" </div> <div> <label>address</label> <input type="text" [(ngModel)]="address" </div> </div> <button (click)=add() >add</button> <button (click)=edit()>edit</button> <button (click)=reset()>reset</button> Note:- On add() both fields should be reset but on edit only address field should be reset

Continue reading

Geting object, both id and value from ngFor on button click angular 6

Issue this is html code <tr> <td>Select New Subject:</td> <td> <Select name=”DesiredSubject” [(ngModel)] = “sub” ngDefaultControl> <option [value]=”0″>–Select Subject–</option> <option *ngFor =”let subj of subjects” [value]=”subj”>{{subj.bank_Name}}</option> </Select> </td> </tr> <tr> <td>Action :</td> <td><button value=”Update Subject” (click)=”changeSubject(sub)”>Update Subject</button></td> </tr> and this

Continue reading

Remove duplicate names in a column

Issue In my angular 6 application, i am making a table with the contents from products array like, Ts: products: any = { “productOne”: [ { “id”: 1, “product_name”: “Product One”, “productOneProperties”: [ { “id”: 1, “property_name”: “Length”, “property_value”: “12cm”

Continue reading

How to loop over multiple tr's with *ngFor & *ngIf

Issue This sample of the template <div *ngFor=”let order of orders” class=”col-1-4″> <tr *ngIf=”order.user_id===user”> <td> {{ order.package_id }} </td> <td> <img src=”{{order.img}}” width=”100″ height=”120″></td> <td>{{ order.name }}</td> <td>{{ order.price }}</td> <td>{{ order.size_i }}</td> <td>{{ order.size_s }}</td> <td>{{ order.color }}</td> <td>{{

Continue reading

How to validate custom input textbox in angular 7

Issue I am trying to show template driven validate error message for custom textbox in angular 7 but not working.Anyone can find the issue?how to resolve this issue? Demo:https://stackblitz.com/edit/angular-7-template-driven-form-validation-yzcwqc?file=app%2Fapp.component.html app.component.html: <div class=”form-group”> <label for=”firstName”>First Name</label> <app-textbox type=”text” name=”firstName” [(ngModel)]=”model.firstName” #firstName=”ngModel”

Continue reading

validating and display error messages for specific form controller in a form array angular

Issue import { Component, OnInit } from ‘@angular/core’; import { FormBuilder, FormGroup, FormArray, Validators, ValidatorFn, AbstractControl } from ‘@angular/forms’; @Component({ selector: ‘my-app’, templateUrl: ‘./app.component.html’, styleUrls: [‘./app.component.css’] }) export class AppComponent implements OnInit { myForm: FormGroup; constructor(private fb: FormBuilder) { }

Continue reading

Cannot Get list from Observable

Issue I want to get a list of strings using localStorage as pesented by: this.userService.getExpertisesListByIdUser(2).map((listExpertises: Array<any>) => { let result:Array<Expertise> = []; let libs:Array<String> = []; if (listExpertises) { listExpertises.forEach((expert) => { libs.push(expert.name); result.push(new Expertise(expert.id, expert.name, expert.username)); }); } localStorage.removeItem(“libs”);

Continue reading

Http post and get request in angular 6

Issue In angular 5.2.x for http get and post I had this code: post(url: string, model: any): Observable<boolean> { return this.http.post(url, model) .map(response => response) .do(data => console.log(url + ‘: ‘ + JSON.stringify(data))) .catch(err => this.handleError(err)); } get(url: string): Observable<any>

Continue reading

How to prevent the delay in evaluating ngIf condition in angular 6? Default image is displayed before evaluating the value. How to prevent this?

Issue component.ts this.canShowPrivateInfo; if (this.canEditDetails || this.loginId == this.loggedInUser) { this.canShowPrivateInfo = true; } else if (this.loggedInUserPrivacy) { this.canShowPrivateInfo = false; } else { this.canShowPrivateInfo =true; } This is the condition ( this.canShowPrivateInfo ) which is used to toggle between

Continue reading

Use promise with async

Issue I’d like to get Object using Promise. Bellow, is the method: async getUri() { var data = this.userService.getOrders(); var outside_uri = await data.then((uri) => { console.log(‘inside => ‘ + uri); return uri;}) console.log(‘outside => ‘ + outside_uri) } where

Continue reading

How to close bootstrap 4 model by calling a function in typescript

Issue I am using bootstrap 4 modal followed by the example Below is the template code: <div class=”container”> <button type=”button” class=”btn btn-primary” data-toggle=”modal” data-target=”#myModal”> Open </button> <div class=”modal” id=”myModal”> <div class=”modal-dialog”> <div class=”modal-content”> <!– Modal Header –> <div class=”modal-header”> <h4

Continue reading

Angular 6 link to section in other component?

Issue I have a navbar component with this code: <ul class=”navbar-nav mx-auto”> <li class=”nav-item active”> <a class=”nav-link” href=”#” >Inicio <span class=”sr-only”></span></a> </li> <li class=”nav-item active”> <a class=”nav-link” href=”#”>Here Link Home Section 2 <span class=”sr-only”></span></a> </li> </ul> and have another component

Continue reading

How to get access to child component object in Angular

Issue I have parent component id=”componentOne” where is included another child component <app-buttons>: <div id=”componentOne”> <app-buttons [component]=”‘WeeklyScheduleComponent'” [buttonTypes]=”[‘add’, ‘filter’]” [position]=”‘right-bottom'” ></app-buttons> </div> Inside component app-buttons there is: ngOnInit() { this.buttonUsage = new ButtonUsage(this.component, this.buttonTypes); } So, how to get access

Continue reading