Thanks to visit codestin.com
Credit goes to github.com

Skip to content

mgol/router

 
 

Repository files navigation

Component Router for Angular 1

Build Status

This project contains the Angular 1 bits and distribution for the Component Router.

The code exists in two parts:

  • the core code, written in TypeScript, lives in the Angular 2 repository
  • the shims, services and directives, specific to Angular 1, live in this repository

In addition this repository contains the tools for building the Component Router distribution files and docs for use in Angular 1 projects.

The core API is still changing, so don't use this in an important production app quite yet, unless you are happy to cope with breaking changes.

Goals

This router aims to fulfill the requirements mentioned in the Angular 2.0 router design document.

Below is a short summary of these goals:

  • Have sensible conventions and defaults
  • Be customizable at almost every point
  • Support sibling "viewports" (like ng-views in Angular 1.x's ngRoute)
  • Support nested routers
    • Allow components to encapsulate entire parts of an application
  • Expose a "navigation model" which can be used to generate a navigation UI (like menus)
    • Expose which route in the model is active (useful in styling/highlighting links in the menu)
  • Generate hrefs based on router hierarchies
  • Be able to reuse component instances
  • Use either push state or hash change mode
  • Handle updating the document title
  • Lazy-load components (partial support)

Layout

The folder structure of the project is as follows:

- node_modules
  - angular2
    - src
      - router : ES5 builds of the Angular 2 router files
- src          : Angular 1 specific router files, will be copied over the Angular 2 router files
- shims        : alternatives to the external module imports in the code

- tmp          : contains the copies of the files that will be webpacked
- dist         : contains the final bundle file

Prior Art

License

MIT

About

The Angular 1 Component Router

Resources

License

Contributing

Stars

Watchers

Forks

Packages

No packages published

Languages

  • JavaScript 100.0%