1.0.9 • Published 6 years ago

@angularclass/resolve-angular-routes v1.0.9

Weekly downloads
15
License
Apache-2.0
Repository
github
Last release
6 years ago

resolve-angular-routes

Resolve Angular 2 Routes for Context

npm install --save-dev @angularclass/resolve-angular-routes

src/
 ├──about/
 |    └──index.ts  // NgModule or Component with either
 |
 └──index.ts // routes

// the router resolve will look for these static properties
// 'routes', 'ROUTER_CONFIG', or 'ROUTE_CONFIG'

// ngRoutes from index.ts
[
  { path: 'about', component: './about' }
]

// context map created
{
  './about': './app/about'
}
import 'core-js/es6';
import 'core-js/es7/reflect';

const resolveNgRoute = require('@angularclass/resolve-angular-routes');

module.exports = {
  // etc
  plugins: [
    new ContextReplacementPlugin(
      /angular\/core\/src\/linker/,
      root('./src'), // root() __dirname helper
      resolveNgRoute(root('./src'))
    ),
  ]
  // etc
}

enjoy — AngularClass

AngularClass ##AngularClass

Learn AngularJS, Angular 2, and Modern Web Development from the best. Looking for corporate Angular training, want to host us, or Angular consulting? patrick@angularclass.com


Apache-2.0

1.0.9

6 years ago

1.0.8

6 years ago

1.0.7

6 years ago

1.0.6

6 years ago

1.0.5

6 years ago

1.0.4

6 years ago

1.0.3

6 years ago

1.0.2

6 years ago

1.0.1

6 years ago

1.0.0

6 years ago