Search Posts

Angular 6 – Bootstraps radio buttons

I’m currently trying to apply bootstraps radio buttons approach on my Angular 6 project. You can apply within a button-group the active state on a button and every time another button gets clicked, the active state switches to the clicked button. Kind of hard to describe with words, but here is the bootstraps documentation (very last section): Bootstraps doc I added this to the components view: <div class=”col-md-3 offset-2″> <div class=”btn-group btn-group-toggle” id=”filterCategory” data-toggle=”buttons”> <label […]

Wrapping angular app with cordova problem with inappbrowser app after login rwditects to an url which opens in browser

I wrapped angular6 app with cordova, and everything works find, but after login, or registering, app is redirected to an url where is server, and opens in browser… I added window.open = cordova. InappBrowser. open inside device ready, but it did not help, after login, page redirects to url, and browser is open Source: Angular

angular e2e testing : how to test Service that have to other services

i’m trying to test my service with e2e test angular 7, my problem is i don’t know how to do that: it’s my service, (the methode return Observable): import { Injectable } from ‘@angular/core’; import { UrlDecoratorService } from “../../common/url-decorator.service”; import { APIFetcherService } from “../common/api-fetcher.service”; import { Observable } from ‘rxjs’; import { IALChrono, ALChrono } from ‘../../common/IALChrono.interface’; @Injectable() export class AnnonceChronoDetailService { private months: string[]; constructor(private urlDecoratorService: UrlDecoratorService, private apiFetcher: APIFetcherService) { } […]

Duplicate Form on click using javascript

addDetails() { const divCreate = document.createElement(‘div’); divCreate.appendChild(document.createTextNode(‘Some text’)); divCreate.setAttribute(‘class’, ‘bg-secondary’); document.getElementById(‘mainForm’).appendChild(divCreate); } The image attached is my form, and onclick I want to add similar form, and once done will submit all values to db. Source: Angular

I need pagination for this records

I neeed Pagination for this Records, For one page It should show 2records, and 2nd page another two records and soon on Upto 10 pages . This is the records to display the code For one page It should show 2records, and 2nd page another two records and soon on Upto 10 pages . mockData() { this.unrealizedTransaction = [ { accountNo: ‘1’, symbolcusip: ”, accountId: 0, longTermGainLoss: 1, pMSecurityTypeId: 0, avgCostIndicator: ”, covered: ”, acquisitionDate: […]

Angular custom class Service Injection

First off, the logic: I have a custom class in my angular application, which is NOT a component(just a simple class with a constructor, private and public variables and input/output methods) and i need it to perform some http calls upon creation, which in their turn are specified in a singleton service. The question: Firstly, is it possible to inject a custom object of a class with a service object? Secondly, is it a correct […]

Argument of type ‘void’ is not assignable to parameter of type ‘string’ in Angular 6

Mycomponent onFileChangedForCV(event) { this.details.= event.target.files[0] } candidateDetails(){ let formData = new FormData(); let photo= formData.append(‘profile_pic’,this.details.photo); let name=this.details.name; let age = this.details.age; let cv = this.details.cv; let experience = this.details.experience; let current_salary = this.details.current_salary; let expected_salary = this.details.expected_salary; let notice_period = this.details.notice_period; if (this.contentEditable){ this.detaisservice.candidateDetailsExperienced(photo(Here throwing ERROR),name,age,cv,experience,current_salary,expected_salary,notice_period) .subscribe( data => { this.details.DetailsResponse = data; if(this.details.DetailsResponse.code ==’200′){ } }, error => alert(error), () => console.log(this.details.DetailsResponse) ); } } MyService File candidateDetailsFresher(photo:string,name:string,age:string,cv:string){ let body = JSON.stringify({photo:photo,name:name,age:age,cv:cv}); let headers […]

How can i get my required data from array of objects using javascript?

I have array of objects like this var a = [ {‘time’ : 1539664755070,’T-1′: 23 }, {‘time’ : 1539665095442,’H-1′: 24 }, {‘time’ : 1539666489560,’T-1′: 42 }, {‘time’ : 1539665095442,’H-1′: 27 }, {‘time’: 1539671682230,’H-1′: 40.45,’T-2′: 33}, {‘time’: 1539671682230,’T-2′: 30.45,’T-1′: 65}, {‘time’: 1539671682230,’T-2′: 42.45,’H-1′: 11}, {‘time’: 1539671682230,’T-1′: 50.45,’T-2′: 85} ]; I want to have data like this data : { ‘T-1’ : [23,42,50.45], ‘T-2’ : [33,30.45,85], ‘H-1’ : [24,27,40.45,11] } How can i get this data from […]

Alternative to using Route Transitions?

This is based on the official docs for route animations. Ultimately my problem is that I must use height: auto because the content defines the height. It seems to me that the act of using transition() at that point always contains both routes on the DOM at the same time. Since a trigger requires either state() or transition() only then I am stuck with having 2 routes on the DOM at the same time by […]

Next Page »