angular-ui-router-extras

Cant access a view within a state in angular-ui-router

好久不见. 提交于 2019-12-25 06:46:14
问题 I am trying to link to a substate and can't figure out how to get it to work. Here is the link: <a ui-sref="tab.communityDashboard" class="button button-block button-large"><i class="icon ion-home"></i><br />Community Directory</a> and here is the route: .state('tab', { url: '/tab', abstract: true, templateUrl: 'templates/tabs.html' }) // Each tab has its own nav history stack: .state('tab.communityDashboard', { url: '/communitydashboard', views: { 'tab-communityDashboard': { templateUrl:

Load a graph from a generated url

倖福魔咒の 提交于 2019-12-24 08:07:43
问题 I want to build an online html/css/javascript playground. When the code draws a graph, I want to be able to generate a url, with which users could load this graph in a browser. At the moment, in the playground, I have a button that links to the function generateUrl : $scope.generateUrl = function () { urls.create({ // allCode is a string like "<html><body><canvas ...>...</canvas><script>...</script></html>" content: $scope.allCode }).success(function (url) { alert(url._id) }); }; Then, I want

$state only works in certain parts of angular app

安稳与你 提交于 2019-12-13 06:12:06
问题 I have gotten $state to work in one part of my application but not the other. It works the first time I call it like this: $state.go('main'); But I call it a little further down like this $state.go('signIn'); and can't get it to work there. What I want this code to do is if a user is not validated by $auth.validator , I want it to redirect to the sign in page with a message that says "You need to sign in". How do I do this? Here is my code: angular.module('starter', ['ionic', 'starter

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

How to inject a service in CustomReuseStrategy in angular?

放肆的年华 提交于 2019-12-11 05:46:58
问题 I have implemented CustomReuseStrategy in Angular. I want to subscribe to an observable in shouldAttach() to determine if the route should be reattached or not. I have created an observable in a service and I need to use the service instance in CustomReuseStrategy. I tried injecting the service in the constructor and I get this error: Can't resolve all parameters for CustomReuseStrategy Should the constructor for the RouteReuseStrategy not have parameters? If so, how do I create the instance

How to get the Previous State with Params using ui-router

大憨熊 提交于 2019-12-03 11:04:16
问题 Problem Statement : I have a button "add comment" , I should be able to add comment only when i have logged into the system. But problem is I cannot come back to "add comment" page after login, because I dont know the previous state or cannot get the previous state. Is there any cleaner solution to this ? Should i have login page a modal rather than a new page ? I have seen all the questions that is taking about previous state and also the possible answers ( yes, i am taking about $rootscope

How to get the Previous State with Params using ui-router

谁都会走 提交于 2019-12-03 00:37:42
Problem Statement : I have a button "add comment" , I should be able to add comment only when i have logged into the system. But problem is I cannot come back to "add comment" page after login, because I dont know the previous state or cannot get the previous state. Is there any cleaner solution to this ? Should i have login page a modal rather than a new page ? I have seen all the questions that is taking about previous state and also the possible answers ( yes, i am taking about $rootscope and $stateChangeSuccess). But it does not clearly put forward the solutions. Other possible solution is