angular-ui-router

Why isn't $injector finding $state in my unit test?

佐手、 提交于 2019-12-12 02:33:00
问题 The following is my module and unit test set-up. When I try to set $ state , $injector.get("$state") throws the always fun Unknown provider: $stateProvider <- $state error and I don't understand why. angular.module("my-module", [ //Third Party "ui.bootstrap", "ui.router", "toaster", "angular-loading-bar", "ngAnimate", "ngSanitize", "ApplicationInsightsModule", "pascalprecht.translate" ]); describe("something descriptive and helpful", (): void => { // a bunch of other service variables.... var

Config issues with Factories in app.js & stateProvider

江枫思渺然 提交于 2019-12-12 02:22:44
问题 I am trying to set up a factory in my app.js of my ionic app. I have the following code that should work however my state provider is throwing me off and Im not sure where my states should be. I was suggested to use this app.js code to get my factory working however it leaves no room for my routes. I have tried different variations of the following with no lck. Thnk you in advance. (function() { 'use strict'; angular .module('starter', []) // In your real application you should put your

APN and GCM Push Notifications opening a url in cordova app

妖精的绣舞 提交于 2019-12-12 02:03:43
问题 Using Cordova PushPlugin and AngularJS I want to receive a push notification and read a URL in the payload and then navigate to that page when the notification is swiped open. How is this accomplished? I tried this, but this is inside of a global function that is outside of angular so I wouldn't suspect the $location to work. It doesn't throw any errors though, but it also does not navigate to the url from the payload. function onNotificationAPN(event) { $location.path(event.custom.url) });

angular-ui router — inherited resolved dependencies for NAMED dependencies

橙三吉。 提交于 2019-12-12 02:03:39
问题 Per the example in the documentation, child states will inherit resolved dependencies from parent states. Furthermore, you can have promises for parent dependencies be resolved before children are instantiated by injecting keys into child states. See example from documentation: $stateProvider.state('parent', { resolve:{ resA: function(){ return {'value': 'A'}; } }, controller: function($scope, resA){ $scope.resA = resA.value; } }) .state('parent.child', { resolve:{ resB: function(resA){

Routes in DART, s server required?

Deadly 提交于 2019-12-12 01:57:39
问题 I tried both AngularDART routes, and routes with Polymer, this example but found, that none is working once I open the file from Dartium directly, but both work perfectly once I run them from Dart editor! am I doing something wrong! thanks 回答1: This is because when you run from DartEditor (Ctrl+R) pub serve is launched which acts as a web server for the browser. This doesn't mean that you need a web server to run this example though. What makes the difference is that pub serve runs

reload: true works only once

蹲街弑〆低调 提交于 2019-12-12 00:42:00
问题 I am trying to pass parameters from one view to another in my anulgar/ionic app. in the volCompute view ($stateParams is declared): if ($stateParams.modelLine){ console.log('receiving', $stateParams.modelLine.id, $stateParams.modelLine.modelStrict) $scope.data.chosenModel = $stateParams.modelLine.modelStrict; } in the compare view: $state.go('app.volCompute', { modelLine: test[0] }, {reload: true}); but it works only one time, if I go back and forth between the two views the code in

How to stop an Multiple SetInterval in Angular based Application

走远了吗. 提交于 2019-12-12 00:37:51
问题 myApp.run(function ($rootScope, $interval, $timeout, $state, $localStorage) { load = function () { cdreset(); // reset the countdown to 0 countdown(); // call the countdown function $rootScope.stayLogin = function () { cdreset(); // reset the countdown to 0 alert("Proceed functioncall"); window.NewTimerCalC = function () { alert('trisssssgered'); return false; }; NewTimerCalCProceed(); }; } $rootScope.$on('$stateChangeStart', function (event, toState, toParams, fromState, fromParams,

Issue on access a service in a ui-router controller

感情迁移 提交于 2019-12-12 00:36:33
问题 I am having issues trying to access a service on a controller. The issue happen when the Ordenes services is called. How I can call a service with two parameter using values from the scope from a controller using ui-router? I have the same code working but without the use of ui-router. It seems like the code is not loading properly the service inside the Controller. App.js 'use strict'; app = angular.module('logica-erp', [ 'ngCookies', 'ngResource', 'ngSanitize', 'ui.router', 'authorization',

Angular ui-router: child state controller not getting called

不羁岁月 提交于 2019-12-12 00:34:28
问题 In my Angular app, I have the following route structure: .state('mapping', { url: '/mapping', templateUrl: 'app/components/mapping/mapping.html', controller: 'MapCtrl as map', abstract: true, authenticate: true }) .state('mapping.all', { url: '', templateUrl: 'app/components/mapping/partials/all.html', authenticate: true }) .state('mapping.project', { url: '/:projectName', templateUrl: 'app/components/mapping/partials/project.html', controller: 'ProjectCtrl as proj', authenticate: true })

AngularJS - Determine if the view should be displayed by an ajax call result upon the route changes

戏子无情 提交于 2019-12-11 23:15:09
问题 To put it simple, I would like to check out that if the session is still alive (which means user has logged in) before displaying the view of some routes, if not, then redirect to log-in view. I have tried to listen to $routeChangeStart event from inside the log-in page, which is displayed initially by default, but user can still go to other views by typing in the routes. Now what I am doing is: (function() { 'use strict'; angular.module("appClubS", ["appClubS.userModule", "appClubS