angular-ui-router

Sub view for $state not rendering in named ui-view

烈酒焚心 提交于 2019-12-24 07:26:30
问题 https://plnkr.co/edit/VV13ty8XaQ20tdqibmFy?p=preview Expected After login the dashboard state renders dashboard.html, and all components and ui-views should render: tickers , tags , social (named ui-view) and feed . Results After login the dashboard state renders dashboard.html however only the components tickers , tags and feed show up, but not the social (named-ui-view) I feel that my problem lies somewhere around where I transition from the login state to the dashboard state. Once you hit

State 'x' is already defined AngularJS ui.router

╄→гoц情女王★ 提交于 2019-12-24 07:23:12
问题 I include a multi-step form in my projet, it works but I have an error on some others pages. Here is the code I used to include the multi step form. Multi-Step form And the error I have Error: State 'uploadForm'' is already defined at n (https://cdnjs.cloudflare.com/ajax/libs/angular-ui-router/0.2.10/angular-ui-router.min.js:7:6487) at q.r [as state] (https://cdnjs.cloudflare.com/ajax/libs/angular-ui-router/0.2.10/angular-ui-router.min.js:7:7429) at http://localhost:51506/js/app.js?v

md-tabs with angular ui-router not rendering grandchildren

谁都会走 提交于 2019-12-24 07:08:08
问题 I am using Angular 1.6.2 with Angular Material 1.3 and making fairly heavy use of components. I have an outer "appComponent" that wraps the rest of the app and provides a header toolbar with navigation, a footer and then my top-level app components load within a ui-view inside the app component. One of my components is a customer maintenance page that has a list in a tab on tab 1 and then customer specific details on tab 2. tab 2 loads another template via ng-include that includes several

Doubly-nested views in UI Router

拈花ヽ惹草 提交于 2019-12-24 05:13:07
问题 Playing around with angular-ui and specifically using the ui-router module to do some nested views. I'm having trouble getting a partial to render within a partial: The nesting is as follows: index.html -main.form.html -main.sidebar.html -sidebar.slider.html My current app.js setup is: $stateProvider .state('main', { url: '/', views: { 'sidebar': { templateUrl: 'views/partials/main.sidebar.html', views: { 'slider': { templateUrl: 'views/partials/sidebar.slider.html' } } }, 'form': {

How to bind controllers contained in a folder to views in angularjs dynamically

喜夏-厌秋 提交于 2019-12-24 04:53:06
问题 I have a controller in a folder named controller at the root. I have view that I want to attach to the corresponding views when the route changes. I am using angular-ui-router. controllers/one.js angular.module('sub',["ui.router"]).config(function($stateProvider){ $stateProvider .state('index', { url: "/login", views: { "viewA": { templateUrl: "login.html" } } }) .state('register', { url: "/register", views: { "viewA": { templateUrl: "register.html" } } }) .state('upload', { url: "/upload",

Angular UI Router ignoring HTML5 Mode off

社会主义新天地 提交于 2019-12-24 04:47:21
问题 Angular UI Router is ignoring HTML5Mode(false), and it's rendering links in a way that can't be bookmarked or directly landing upon: app.js: $stateProvider .state('search', { url: '/search', views: { 'main.wrapper': { templateUrl: 'views/search.html', controller: 'SearchCtrl' }, 'navbar': { templateUrl: 'views/search.navbar.html' } }); $locationProvider.html5Mode(false); foo.html: <a ui-sref="search">Search</a> Becomes <a href="/search">Search</a> Shouldn't it detect it's not on HTML5 Mode

How can I mock ui-router's resolve values when testing a state's configuration?

别说谁变了你拦得住时间么 提交于 2019-12-24 04:23:11
问题 I'm writing an angular application using ui-router and I'm looking to write tests for my ui-router configuration. Specifically, I'm looking to test my onEnter and onExit callbacks bound to a state. These callbacks rely on resolves which are defined on the state. How can I mock out the resolves being used in the onEnter and onExit functions? For example, say I have a state defined as follows: // bobConfig.js .state('bob', { url: '/bob', templateUrl: "bob.html", controller: "bobController",

BrowserModule has already been loaded

拈花ヽ惹草 提交于 2019-12-24 04:01:13
问题 This is my code: import { CommonModule } from '@angular/common'; import { HttpClientModule } from '@angular/common/http'; import { NgModule } from '@angular/core'; import { BrowserAnimationsModule } from '@angular/platform-browser/animations'; import { LanguageTranslationModule } from './shared/modules/language-translation/language-translation.module' import { AppRoutingModule } from './app-routing.module'; import { AppComponent } from './app.component'; import { AuthGuard } from './shared';

Create states from array object in Angular ui-router

时光怂恿深爱的人放手 提交于 2019-12-24 03:32:07
问题 I am able to create a state from an object like so... var stateTest = { name: '2', views: { 'video': { templateUrl: 'templates/2_video.html', controller: 'VideoCtrl' }, 'content': { template: '{{content}}', controller: 'VideoCtrl' } } }; $stateProvider.state(stateTest); but what I need to do is create states from an array. This was my attempt and it is not working. var stateList = [ { name: '3', views: { 'video': { templateUrl: 'templates/3.html', controller: 'VideoCtrl' }, 'content': {

Getting Error: Unkown provider: $urlMatcherFactory

这一生的挚爱 提交于 2019-12-24 03:27:44
问题 Unkown provider: $urlMatcherFactory This is the error message that Angular throws when I try to inject $urlMatcherFactory in the app config. I have included the ui-router JS file and have been using it for last few months. I need to do something like this: var dateMatcher = $urlMatcherFactory.compile("/day/{start:date}"); $stateProvider.state('calendar.day', { url: dateMatcher }); as this example shows. Normally code like this won't identify $urlMatcherFactory . So I tried injecting it as a