es6-router
Installation
npm package ()
Usage
Route Component Definition
'use strict';
import main_module from '@thinkeloquent/es6-router';
const app = angular.module('app', ['ngComponentRouter']);
app.component('app', {
template: `<ng-outlet></ng-outlet>`,
$routeConfig: [
{
path: '/',
name: 'Home',
component: 'home',
useAsDefault: true
},
{
path: '/about',
name: 'About',
component: 'about'
}
]
});
app.component('home', {
template: '<h2>Home Page</h2>',
})
app.component('about', {
template: '<h2>About Page</h2>',
})
main_module.angular['1.6.x'].router.register(app);
Examples
Resources