I have an AngularJS service written and I would like to unit test it.  angular.module('myServiceProvider', ['fooServiceProvider', 'barServiceProvider']).     factory('myService', function ($http, fooService, barServi...
I'm writing an angularJS app. In this particular controller, I open a new browser window through the $window.open service. But in the new window, all the $scope variables are lost.  I tried to use window.parent but this doesn't work. In fac...
I have a service in Angular which uses my API to get user information and provides it to my controllers. It's set up like this:  angular.module('myApp', ['myApp.filters', 'myApp.services', 'myApp.directives', '...
I am trying to get my angular application work in live mode as well as in a prototype mode just by overriding the services. As a part of this when the prototype mode is turned on in the config, i halt the bootstrap process, load mock services (js) fi...
I've multiple controllers in my application, where I have some duplicate code like:  $scope.alert = null;  $scope.addAlert = function (message) {     $scope.alert = { type: 'danger', msg: message }; };  $scope.clearAlerts = function () {...
I tried to find some good examples on best practice in moving $watch functions from a controller to a factory, for example.  What I have found is that actually there isn't a unanimous opinion on what's best to do. I've seen examples of in...
In my app I have window instances. The app can contain multiple windows and windows can contain multiple views. The views are children of each window instance. The windows and view creator are directive with an isolated scope. I want the views to be...
I'm using Angular v1.2.20 with the Ionic Framework. I have seen many articles and posts about how to handle 401 errors from the server by using an interceptor and pushing it into the $httpProvider.interceptors array.  For some reason, 401 respons...
After reading several articles on avoiding scope soup and referencing the Google Guidelines for building controllers I have been left with one burning question. How should I reference my injected  dependencies within my controller?   My approach thus...
I am accessing an API via Angular $http requests to gather information for different football teams.   If I were to be only accessing one team, this would be fine - I would create a Service that made the call, then reference the Service function in m...

Tags

Recent Questions

Top Questions

Home Tags Terms of Service Privacy Policy DMCA Contact Us

©2020 All rights reserved.