Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

what does abstract:true do in ui-router?

Sorry my question may seems duplicate beacuse i'm learning Angular JS with some downloaded template but i dint get anything what i exactly need with my searching.

what does abstract: true means?

the main question is .otherwise('/app/dashboard'); taking me to partials/app_dashboard.html if i had mentioned /dashboard in otherwise it should take me there but why /app/dashboard landing me in partials/app_dashboard.html. does abstract: true have any effect in otherwise?

header div, container div(ui-view) and footer div was placed in app.html

$urlRouterProvider

        .otherwise('/app/dashboard');
    $stateProvider            
        .state('app', {
            abstract: true,
            url: '/app',
            templateUrl: 'partials/app.html'
        })
        .state('app.dashboard', {
            url: '/dashboard',
            templateUrl: 'partials/app_dashboard.html'
        })
        .state('app.ui', {
            url: '/ui',
            template: '<div ui-view class="fade-in-up"></div>'
        })
like image 751
maghub Avatar asked Aug 27 '14 10:08

maghub


People also ask

What is abstract state in AngularJS?

Abstract state does mean the state that you wrote can't be accessible directly.

What does UI sref do?

A ui-sref is a directive, and behaves similar to an html href . Instead of referencing a url like an href , it references a state. The ui-sref directive automatically builds a href attribute for you ( <a href=...> </a> ) based on your state's url.

What is UI in Router?

UI-Router is the defacto standard for routing in AngularJS. Influenced by the core angular router $route and the Ember Router, UI-Router has become the standard choice for routing non-trivial apps in AngularJS (1. x).

What is UI Router in angular?

Angular-UI-Router is an AngularJS module used to create routes for AngularJS applications. Routes are an important part of Single-Page-Applications (SPAs) as well as regular applications and Angular-UI-Router provides easy creation and usage of routes in AngularJS.


1 Answers

abstract - {boolean=} - An abstract state will never be directly activated, but can provide inherited properties to its common children states.

From ui-router docs

like image 144
Roman Kolpak Avatar answered Dec 07 '22 01:12

Roman Kolpak