Questions tagged as 'angularjs-services'

3
answers

HTTP post in Angular

I'm trying to access a web service that gets in the Header "Device" and Body "User and Password", it returns me json in this format: { "IdUsuario": 2, "Usuario": "Fulanu", "Token": "1f7b87d7" } Trying to do this in angle, follow my c...
asked by 03.11.2016 / 22:57
1
answer

Doubt in AngularJS! (Factory, Controller, View) Why is 'identity' not updated in VIEW?

I have a question in AngularJS! The source code is at link In the factory I have a property named identity , which is mirrored to the controller and displayed in the view. When adding a new message this property is incremented corr...
asked by 25.01.2016 / 21:05
1
answer

value passed via Service is not being updated in the second controller

I tried to share a scope between two controllers , and I saw that one option would be the service or a factory > that use the singleton pattern, but I have already tried both and what happens is that I can not set the value of a controll...
asked by 03.04.2018 / 21:24
0
answers

Problem with angular service method

I have two methods in my angular service .. which are: app.service('entidade', function($http) { this.getEntidade = function() { return $http({url:'/user/entidades', method : 'GET', async:false}).then(function(response) {...
asked by 06.04.2018 / 16:22
1
answer

How to clean a service at the end of its use Ionic / AngularJs

I have a service that looks like this: angular.module('nhaac.services', []) .factory('sharedCartService', ['$ionicPopup',function($ionicPopup){ // OKAY, MAS ONDE ELE ESTÁ PEGANDO? // DECLARA AS VARIÁVEIS var cartObj = {};...
asked by 29.03.2017 / 21:20
2
answers

Sensitive and global ionic 3 and angular 4

I have some sensitive variables, and it would be ideal to leave all the variables in one environment, when it is necessary to change, for example from production to development, this task becomes easy. Ex: @Injectable() export class Restaur...
asked by 05.06.2017 / 21:27
2
answers

Injection error of module dependencies in angular

I have the module for my application: angular.module('app', ['app.controllers','app.routes','app.services']); I have my services module: angular.app('app.services', []) .factory('usuarioService', ['$rootScope', 'renderService',...
asked by 26.04.2016 / 21:38
1
answer

NullInjectorError Error: No provider for

I'm having this error message: ERROR Error: StaticInjectorError[CervejaService]: StaticInjectorError[CervejaService]: NullInjectorError: No provider for CervejaService! at _NullInjector.get (core.js:993) at resolveToken (core.j...
asked by 17.01.2018 / 12:00
1
answer

Message appears in modal and page at the same time

I created a "message center" in Angularjs that injects messages on the screen. The message always appears when an error occurs in the REST or success operations. This is done by an interceptor that checks whether the response has a message heade...
asked by 04.03.2016 / 13:05
1
answer

How to find out the current $ location

How do I validate when there is a change in the screen and the user clicks on another hyperlink to leave the screen, it can not allow. Is there any ready-made angular function that performs this check? At the moment I'm trying to use the...
asked by 01.02.2016 / 14:40