Questions tagged [angular2-services]

Use this tag for questions related to Angular 2 Services, which are JavaScript functions responsible for performing a single task.

Useful Links:

  1. Services - tutorial
2204 questions
0
votes
0 answers

Angular 2 Json inside another array get headers key value in html

"url" : "https://reqres.in/api/users?page=2", "method" : "GET", "authorization" : null, "headers" : "[{\"key\":\"wrtwrt\",\"value\":\"wrtwr\"}]", "body" : ",[{\"key\":\"\",\"value\":\"\"}]", "urlType" : "PULLEXPENSE", "createdBy" : { "id" :…
0
votes
0 answers

exporting Angular 4 service as array of injectables

I know there is the following way of defining injectable services in Angular 2/4 (correct me if I am wrong somewhere, please): @Injectable() export class SomeService { ... } export const someServiceInjectables: Array = [ …
0
votes
2 answers

Excel upload using Angular2(Frontend) and Spring Boot (Backend)

I am new to Angular 2 and I am trying to upload an Excel from Angular 2 frontend. I want to upload the Excel from Angular 2 frontend, pass it to Spring Boot in backend, inside Spring Boot I will make necessary changes. Finally pass it back to…
0
votes
1 answer

Angular 2 - Sweet alert call back function not working

I am trying to delete an item in my angular cli app. I've used sweet alert as an alert and i want to delete an item from the list. Here is a code for that. This code is in typescript file. import { AuthenticationService } from…
parth
  • 624
  • 1
  • 10
  • 29
0
votes
0 answers

Create a node with it's sub-nodes from more than 1 page anuglar4 and firebase

I am working on a markets application using angular 4 and I have an issue on adding a new category that contains nothing and the name of the category will be the uid of the sub items and each item contains some details of specific item. On adding…
0
votes
0 answers

How to use Interface or Model to access nested JSON in Angular2/4?

I am not able to map the nested json array from my local mock data. The json data is supposed to be like { success: true, data: { count: 2, pageNo: 1, pageSize: 10, list: [ { title: 'title', subtitle: 'subtitle', …
Nan Zhao
  • 1
  • 2
0
votes
0 answers

Application with angular 2 'Access-Control-Allow-Origin' Issue when requesting Restfull API

I trying make a Http request and this issue happens, but I just did the same request before and works, the only diference is the url. the service file import { Observable } from 'rxjs/Rx'; import { Http, Response } from '@angular/http'; import {…
0
votes
2 answers

Observable in a callback function - angular 2

I am trying to implement a callback function in a service class, which has to return data back to the component class. ChatComponent.ts export class ChatComponent implements OnInit { constructor( public _chatService : ChatService) { …
Anish
  • 2,889
  • 1
  • 20
  • 45
0
votes
1 answer

Getting error for auth0-js not found Angular2

I am trying to create login for my angular2 app using auth0. I am following the link below:- https://auth0.com/docs/quickstart/spa/angular2 I did the following steps:- Configure Callback URLs Install auth0.js npm install --save auth0-js retrieve…
user8255292
0
votes
0 answers

How to convert angular 1 modal service into typescript angular 2?

I really would like to convert the following code to angular 2. Would it consist of writing alot of extra logic? Notice how this is simple and straight to the point. I have a modal service angular.module('app').service('myModalService', function…
CodeMan03
  • 570
  • 3
  • 18
  • 43
0
votes
1 answer

Can't resolve all parameters -getting this error in browser angular2

I am trying to create a movie finder website using api key .Everything looks perfect as far as code as well as the api key -i could access the values just by hitting the api request but getting error in browser.Appreciate if some one can help…
Code_1993
  • 127
  • 1
  • 4
  • 16
0
votes
1 answer

Execute method only once after all changes have happened in Observable in Angular ReplaySubject

I have created a service which checks for changes in parent component and send notifications to the child component. Below is the simple service. import { Injectable } from '@angular/core'; import { ReplaySubject } from 'rxjs/ReplaySubject'; import…
Joseph M Njuguna
  • 417
  • 1
  • 4
  • 9
0
votes
1 answer

angular 2+ refresh callback not working as expected

i have one issue with angular 2+ and typescript, i have 2 components and one service, what i need to achieve is when i open Modal(component) and do one action (in my case i do http.post) so when i click Add button inside modal i need to run another…
Sahbaz
  • 1,242
  • 4
  • 17
  • 39
0
votes
1 answer

How can i cache/preload all images of a Angular2 webapp?

i am developing a webapp and it is almost finished. The problem is that there are a lot of images at the assets folder and when i am navigating the screen sometimes blinks changing the webapp background images. Is it possible to preload all the…
0
votes
1 answer

Angular 2 custom validator with service not working

I implemented angular custom validator which works if I hardcode the main logic this way import { Directive, forwardRef } from '@angular/core'; import { NG_VALIDATORS, FormControl } from '@angular/forms'; import { UserAdministrationService } from…
kosnkov
  • 5,609
  • 13
  • 66
  • 107
1 2 3
99
100