angular-ui-router

Angular-UI Router - Resolve not waiting for promise to resolve?

家住魔仙堡 提交于 2019-12-12 12:06:51
问题 So to summarise I am using angular-ui router resolve function to retrieve state specific data. However it doesn't seem to full wait for the promise to resolve: state('parent.ChildState', { url: '/myUrl?param1&param1', templateUrl: 'views/list.view.html', controller: 'MyController', resolve: { data: resolveData } }). function resolveData($stateParams, Utils) { var filters = Utils.getFilters($stateParams); DataService.myDataObj = DataService.get(filters, function(result, headers) { DataService

Maintain state of Search page after navigating back from details page in Angular

久未见 提交于 2019-12-12 11:51:40
问题 I'm new to angular and I have a requirement to maintain the state of the search results page(i.e preserve the sort and filter values of the search results grid) when the user navigates to the details page by clicking on a link in search results grid and navigates back to the search page again. I tried using CustomReuseStartegy but I'm facing 2 issues: Need to update the search results when the user makes some changes in the details page. Once the page is detached. It is not getting attached

Why does this Angular ui router code cause an infinite loop in $digest?

风流意气都作罢 提交于 2019-12-12 10:58:25
问题 I've boiled the code down as much as I can. Something about nested states and the event handling/broadcasting is causing an infinite loop. In Chrome I can pause it and see that it is looping forever in Angular's $digest function. Any idea why? Is it a bug in my example code, or a bug in Angular, or the UI Router? <!doctype html> <html ng-app='bugapp' ng-controller='BugAppCtrl'> <head> <script src='//code.jquery.com/jquery-1.10.1.min.js'></script> <!-- Angular 1.2.11 --> <script src='//ajax

$rootScope.$on(“$routeChangeSuccess) or $rootScope.$on(”$stateChangeSuccess) does not work when using ui-router(AngularJS)

我只是一个虾纸丫 提交于 2019-12-12 10:37:26
问题 I am using UI-router for nested views in my application but at the sametime I want to listen for events when the route changes. Before using UI-router routeChangeSuccess was firing just fine but after ui-router it does not fire. Documentation suggests to use viewContedLoaded or stateChangeSuccess to be used but even they dont get fired. I am pasting my code snippet. Any help would be appreciated. var app = angular.module('SmartKart', ['ngCookies','ngRoute','ui.bootstrap','angularPayments',

Angular UI-Router: Multiple URLs to single state

大兔子大兔子 提交于 2019-12-12 10:36:52
问题 I have started using angular's ui-router, and I am trying to figure out how to have multiple URLS refer to a single state. For example: /orgs/12354/overview //retyrns the same pages as /org/overview My $state provider is currently set with something like this, and its unclear to my how to slip in the alias '/org/overview' route such that it properly inherits from the 'org' parent. .state('org', { abstract: true, url: '/orgs/:orgID', templateUrl: '/client/navigation/main.html' }) .state('org

Angular UI-Router : URL changed but view isn't loaded

喜欢而已 提交于 2019-12-12 10:31:23
问题 I'm working on my UI-Router app with nested views. I defined some states like this: $stateProvider .state('parent', { url: "/parent", views: { 'area1': {templateUrl : 'parentView.html'}, 'area2' : ... // some other areas + template } }) .state('parent.child1', { url: "/child1", views: { 'area1' : {templateUrl : 'child1View.html'}, 'area2' : ... // still some other areas, not changing } }) .state('parent.child2', { url: "/child2", views: { 'area1' : {templateUrl : 'child2View.html'}, 'area2' :

UI Router dynamic <title> tag

末鹿安然 提交于 2019-12-12 10:14:29
问题 I'm adding a title to every state in the ui-router like that: .state('projects', { url: '/', templateUrl: 'projects/projects.html', ncyBreadcrumb: { label: 'Projects' }, data : {title: 'Projects'} }) And then the title attribute takes that data: <title ng-bind="$state.current.data.title"></title> How can I take data from the state parameters and add it to the title in the above example? I tried the following with no luck: .state('project', { abstract: true, url: '/projects/:projId', resolve:{

How to prevent $state from refreshing any Component that does not rely on the $state.var being changed?

倾然丶 夕夏残阳落幕 提交于 2019-12-12 09:21:25
问题 We're using Angular-ui-router for our app state management. A problem we're having is that every component refreshes when the $state changes, even if it's a variable that is updated that does not exist/not used in some components. For example, we have a TickersPanel and a TagsPanel. When a Ticker is selected, the TagsPanel should be updated and refreshed, however when a tag is selected in the TagsPanel, the TickersPanel should NOT refresh, but it currently does. I found out that { notify:

Deeply nested breadcrumbs with sibling states, UI-Router and ncyBreadcrumb

拈花ヽ惹草 提交于 2019-12-12 09:01:59
问题 I have inherited a project recently that uses UI-Router to route between states in a management portal site. There are certain complexities to this portal that require our states to primarily be siblings, rather than related parent/child. This has created an issue getting breadcrumbs to work using ncyBreadcrumb. Before I ditch ncy and develop something of my own, I am wondering if there is a way to resolve my issues. The classic ui-router example is the contact list. You may have an index

Dynamically changing View in AngularJS UI-Router

时光总嘲笑我的痴心妄想 提交于 2019-12-12 08:56:49
问题 I have a walkthrough in my app which comprises 4 pages. I decided to make the Walkthrough a single state with multiple views to represent each of the 4 pages. In my html I define a div as a ui-view pointed to the current view, which my controller then changes around as necessary. The problem is, when I update $scope.currentView to 'general' it does not change what's actually seen on the screen! If I manually change it to 'general' in my _init function it does show the general page, but I