New Research: Supply Chain Attack on Axios Pulls Malicious Dependency from npm.Details →
Socket
Book a DemoSign in
Socket

@angularclass/resolve-angular-routes

Package Overview
Dependencies
Maintainers
4
Versions
10
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@angularclass/resolve-angular-routes

Resolve Angular 2 Routes for Webpack Context creation

latest
Source
npmnpm
Version
1.0.9
Version published
Weekly downloads
29
190%
Maintainers
4
Weekly downloads
 
Created
Source

Angular 2 Fundamentals

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

FAQs

Package last updated on 07 Aug 2016

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts