Skip to content
This repository was archived by the owner on Jan 18, 2024. It is now read-only.

softsimon/ui-router-route-to-components

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

19 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

ui-router-route-to-components

Route to components today using Angular 1.5+ and ui-router 0.2.x+

Usage

Add module dependency 'ui.router.components'

Example state config:

.state('users', {
	parent		: 'header',
	url			: '/users/:id',
	component  : 'users',
})

Or

.state('users', {
	parent		: 'header',
	url			: '/users/:id',
	views			: {
		'content@': {
			component  : 'users',
		}
	}
})

Resolve:

.state('users', {
	parent		: 'header',
	url			: '/users/:id',
	component  : 'users',
	resolve: {
        data: function () {
	        return "some data";
        }
	}
})

.component('users', {
    bindings: {
        data: '<'
    },
    controller: UsersController,
    templateUrl: '../app/users/users.template.html',
});

function UsersController() {
    console.log(this.data); // "some data"
}

Credits

Code mostly borrowed from angular-ui/ui-router#2547 but extended to also support multiple named views.

About

UI-Router Route To Component Extension

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Contributors 4

  •  
  •  
  •  
  •  
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy