ui-router-route-to-components

WebJar for ui-router-route-to-components

License

License

ISC
Categories

Categories

Github Development Tools Version Controls
GroupId

GroupId

org.webjars.bower
ArtifactId

ArtifactId

github-com-softsimon-ui-router-route-to-components
Last Version

Last Version

0.1.0
Release Date

Release Date

Type

Type

jar
Description

Description

ui-router-route-to-components
WebJar for ui-router-route-to-components
Project URL

Project URL

http://webjars.org
Source Code Management

Source Code Management

https://github.com/softsimon/ui-router-route-to-components

Download github-com-softsimon-ui-router-route-to-components

How to add to project

<!-- https://jarcasting.com/artifacts/org.webjars.bower/github-com-softsimon-ui-router-route-to-components/ -->
<dependency>
    <groupId>org.webjars.bower</groupId>
    <artifactId>github-com-softsimon-ui-router-route-to-components</artifactId>
    <version>0.1.0</version>
</dependency>
// https://jarcasting.com/artifacts/org.webjars.bower/github-com-softsimon-ui-router-route-to-components/
implementation 'org.webjars.bower:github-com-softsimon-ui-router-route-to-components:0.1.0'
// https://jarcasting.com/artifacts/org.webjars.bower/github-com-softsimon-ui-router-route-to-components/
implementation ("org.webjars.bower:github-com-softsimon-ui-router-route-to-components:0.1.0")
'org.webjars.bower:github-com-softsimon-ui-router-route-to-components:jar:0.1.0'
<dependency org="org.webjars.bower" name="github-com-softsimon-ui-router-route-to-components" rev="0.1.0">
  <artifact name="github-com-softsimon-ui-router-route-to-components" type="jar" />
</dependency>
@Grapes(
@Grab(group='org.webjars.bower', module='github-com-softsimon-ui-router-route-to-components', version='0.1.0')
)
libraryDependencies += "org.webjars.bower" % "github-com-softsimon-ui-router-route-to-components" % "0.1.0"
[org.webjars.bower/github-com-softsimon-ui-router-route-to-components "0.1.0"]

Dependencies

compile (1)

Group / Artifact Type Version
org.webjars.bower : angular-ui-router jar [0.2.0,1.0.0)

Project Modules

There are no modules declared in this project.

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 https://github.com/angular-ui/ui-router/issues/2547 but extended to also support multiple named views.

Versions

Version
0.1.0