angular-ui-router

How to reload the current state?

本秂侑毒 提交于 2019-12-16 20:34:07
问题 I'm using Angular UI Router and would like to reload the current state and refresh all data / re-run the controllers for the current state and it's parent. I have 3 state levels: directory.organisations.details directory.organisations contains a table with a list of organisations. Clicking on an item in the table loads directory.organisations.details with $StateParams passing the ID of the item. So in the details state I load the details for this item, edit them and then save data. All fine

How to reload the current state?

99封情书 提交于 2019-12-16 20:32:53
问题 I'm using Angular UI Router and would like to reload the current state and refresh all data / re-run the controllers for the current state and it's parent. I have 3 state levels: directory.organisations.details directory.organisations contains a table with a list of organisations. Clicking on an item in the table loads directory.organisations.details with $StateParams passing the ID of the item. So in the details state I load the details for this item, edit them and then save data. All fine

Check angular ui route state using protractor

纵饮孤独 提交于 2019-12-14 04:25:13
问题 I'm using protractor framework to test my angular application. Can I check for the angular state in the e2e test? 回答1: Sure, the idea is to use browser.executeAsyncScript() to: locate the element having the ng-app defined initialize the angular.element and get the injector instance get the $state service use $state.current.name to get the current state's name Sample working test using the UI router demo page: describe("Current Angular UI router state", function () { beforeEach(function () {

Phonegap Android Back Button w/ Ionic and Angular

廉价感情. 提交于 2019-12-14 03:59:15
问题 I'm having issues disabling the back button for Android in a Phonegap project using Ionic Framework / Angular JS. I have tried many other proposed solutions to no avail. The problem is I have a 'Login' screen which is a modal (ionicModal), but Android users are able to use the back button to navigate away regardless of if they are logged in or not. I tried disabling the Android Back button all together. The event fires, but the page navigation still happens. I feel like if this worked, this

Ui Router tabs with routing

六眼飞鱼酱① 提交于 2019-12-14 03:14:10
问题 I'm using UI-Router and I need to hook up tabs where the url changes as well. So for example, I have a page with 3 sublinks: Customer Overview (templates/customer.overview.html): example.com/customer/:id/overview Customer Settings (templates/customer.settings.html): example.com/customer/:id/settings Customer Contact Info (templates/customer.contact.html): example.com/customer/:id/contact All three of these pages should be injected into one main customers.main.html page that includes the links

Angular ui-router - Curly brackets etc in url

佐手、 提交于 2019-12-14 02:53:22
问题 I have been searching for a way to have curly brackets {} and slashes / in the URL. But the URL looks like this: URL appearance now: http://localhost/#/?ph=tes:testes%2Ftest%7Blb0%7D URL wanted appearance: http://localhost/#/?ph=tes:tests/test{lb0} How do I get an URL without the %2f etc? Thanks in advance! 回答1: All valid characters that can be used in a URI (a URL is a type of URI) are defined in RFC 3986. All other characters can be used in a URL provided that they are "URL Encoded" first.

Creating a JSFiddle with Angular-ui-router and multiple views

对着背影说爱祢 提交于 2019-12-14 02:17:38
问题 I have a question I would like to ask the community, but am having trouble setting up the required JSFiddle to make it easier to demonstrate the issue. I want to create a fiddle with three views side by side using Angular's ui-router. Seems simple, but for some reason I can't get the views' controller's to initialize. The main app loads, as evidenced by console messages, but I'm stumped. The Fiddle is here, and for completeness sake, the html and js are here: HTML: <div ui-view="top" class=

Bad timing or order of functions with resolves on Ui-Router

删除回忆录丶 提交于 2019-12-13 21:59:36
问题 I have an app where my main state makes a resolve makes an http call and fetches an array. Then, the child array is supposed to display one object from this array, but it seems that the variables from the controller are defined too early and don't get updated properly, so the child comes out empty. I've tried it without http call ( var array = [array] ), and it works fine, but not with the http call. Any tips on how to fix this? Here's the controllers: .controller('appCtrl',['$scope',

Multiple Views with nested views Angular

走远了吗. 提交于 2019-12-13 21:08:59
问题 So first off, I'm working on this for a project at work, but none of us have any idea how to do it, so it might be kind of vague. Here is the template of how it is going to look: Template So View A & B are going to have 3 states in them that will change the content of the view based on which one is selected The problem I'm having is that only 1 view ever shows up and it is a test template for now because I don't have those views built but none of the sub views of View A ever show up. HTML

Page loading with $rootScope variable - variable not set on state change

让人想犯罪 __ 提交于 2019-12-13 21:01:09
问题 I'm setting $rootScope.pageLoading = 1 in the router config like this: .state('app', { abstract: true, url: '', templateUrl: 'tpl/app.html', resolve: { loading: function($rootScope){ $rootScope.pageLoading = 1; } }, controller: 'AppCtrl' }) And in the top level of the document, I have a spinner: <!-- page loading --> <div id="page-loading" ng-show="pageLoading"> <small-spinner class="spinner fa-spin"></small-spinner> </div> When a page loads, I cancel the spinner inside the page's controller,