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 have the following service (it actually has more levels and elements but I trimmed it down to just a single example of what I'd like to work). It creates javascript objects within other objects dynamically based on csv files in the app.data fol...
I have defined a custom http service in angular that looks like this:  angular.module('myApp')   .factory('myhttpserv', function ($http) {    var url = "http://my.ip.address/"    var http = {       async: function (webService)...
I've got the following service:  angular.module("services") .factory("whatever", function($window) {   return {     redirect: function() {       $window.location.replace("http://www.whatever.com");     }   }; });   How to...
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...

Tags

Recent Questions

Top Questions

Home Tags Terms of Service Privacy Policy DMCA Contact Us

©2020 All rights reserved.