angular-ui-router

How do I show multiple views in an abstract state template?

≯℡__Kan透↙ 提交于 2019-12-24 14:36:57
问题 Using Angularjs UI-Router I'm trying to build a typical page with a main view and a side refine/filter results view. I've forked the sample app and now modifying it to have a parent abstract state that displays the filters view and the main view so that I can share the data that the abstract state resolves. The problem is I cannot get the filters view to appear without breaking the scope inheritance. If I add the 'views' param it breaks the scope so how can I get this to work? Here's my code

Angular JS resolve in a resolve

核能气质少年 提交于 2019-12-24 14:27:43
问题 What I mean by resolve in a resolve is that I want to be able to resolve the user first, and then resolve all his additional info, eg, addressess, contacts, friends. What I currently have: .state('website', { url : '', abstract : true, resolve : { // Request the current signed in user > current_user : ['Auth', function(Auth){ return Auth.requestUser(); }] }, views : { 'main' : { templateUrl : 'template.html' } } }) What I'll like to do is the following: .state('website', { url : '', abstract

Adding Angular directive using decorator

梦想的初衷 提交于 2019-12-24 13:48:49
问题 I'm using Angular 1.4.8 with Angular UI. What I'm trying to do is decorate the ui-sref directive so it will highlight a menu element (by setting the CSS class 'active') if the current $state.name matches the ui-sref state. I test to see if the element is descendent from my nav header, and if it is, I want to add an ngClass attribute to the element. For right now, I just want to make them all highlight; I can add the test for matching the state later. The true will be replaced with the actual

Non-hierarchical url scheme for a dashboard application

走远了吗. 提交于 2019-12-24 13:21:52
问题 What is the angular way for maintaining a URL scheme in the following context: the app contains a sidebar where the user can select a number of datasets, and modify the selection later on. there's a dashboard canvas onto which a user can dynamically add a number of windows that contain different types of figures. These figures are plotted based on certain variables. The URL scheme I'm thinking would allow me to keep track of the selected datasets, current active windows, their parameters and

AngularJS $state.go executes before previous statement execution completes

这一生的挚爱 提交于 2019-12-24 13:05:01
问题 I am using AngularJS, ui-router and $resource for RESTful webservices. A button in html view is clicked that calls below function i.e. $scope.login(). Consequently a REST service (through $resource) is called and returns a user in case user/pass are correct, $scope.login = function() { myfactory.get({ email: $scope.user.email, password: $scope.user.password },function(user) { accessmgr.grantAccess(user); //Line of interest - loi1 $state.go('app.dashboard-v1'); //Line of interest2 - loi2 },

URL is not changing even after the state is changed . `ui-router`

会有一股神秘感。 提交于 2019-12-24 12:33:46
问题 I am using ui-router and state provider to route the pages in my application. I have following states written in state provider. .state('home', { url: '/home', templateUrl: 'public/msStream/stateFiles/stateHome.html', controller: 'stateHomeController' }) .state('home.profile', { url: '/home/profile', templateUrl: 'public/msStream/views/setting/ProfileBody.html' }) When I am in home state. /home is added in my URL, but when I switch to home.profile state using $state.go("home.profile) , my URL

default child inside father in $stateprovider with typescript

◇◆丶佛笑我妖孽 提交于 2019-12-24 12:23:08
问题 I have an html page father with: <div id="..." class="container"> <pp-nav></pp-nav> <div ui-view></div> </div> This is my controller with a father and two child: export function routerConfig($stateProvider: angular.ui.IStateProvider, $urlRouterProvider: angular.ui.IUrlRouterProvider) { $stateProvider .state('gestionePeP', { url: '/gestionePeP', templateUrl: '.../gestionePeP/gestionePeP.html' }) .state('gestionePeP.puntiAttivazione', { url: '/puntiAttivazione', templateUrl: '.../gestionePeP

ui-view doesn't work when used inside angularjs custom directives

谁说我不能喝 提交于 2019-12-24 12:04:15
问题 I want to wrap some ui-view elements inside a custom angularjs directive <wrapper> <ul> <li><a ui-sref="route1">Route 1</a></li> <li><a ui-sref="route2">Route 2</a></li> </ul> <div class="well" ui-view="viewA"></div> <div class="well" ui-view="viewB"></div> </wrapper> The custom directive does nothing but transcluding the content: myapp.directive('wrapper', function($compile){ return { restrict: 'E', replace: true, transclude:true, template: '<div class="godWrapper" ng-transclude></div>' }; }

Angular ui-router : Container view and Default view

笑着哭i 提交于 2019-12-24 11:50:45
问题 I am struggling to create a container for next states, defined the states as views, divided into header, CONTAINER, footer. The next state as an example would be the blogs, but I do not see a way of getting it into the view. One idea was to start the HOME view as standard, but also failed. view: <main> <header ui-view="header"></header> <content ui-view="home"></content> <footer ui-view="footer"></footer> </main> states: .state('home',{ url:'/', data: { pageTitle: 'Home' }, views: { '': {

Angular-UI-Router: should i avoid href with ui-router?

岁酱吖の 提交于 2019-12-24 10:45:34
问题 Looking through the reference to ui-router (https://github.com/angular-ui/ui-router/wiki/Quick-Reference#ui-sref) the following is said about ui-sref: the directive will automatically generate & update the href attribute via the $state.href() method All things considered, this essentially makes ui-sref a full replacement to href: not only it works with states, but also takes care of url. Does it mean that in an angular ui-router app it is best to avoid hrefs even for global, SPA-wide pages