• About Morris Development
  • A Focus for Cloud Efficiency
    • Microsoft Azure
    • Amazon Web Services
  • What our Clients Say
  • Our Products
    • PreschoolDB
    • WebinarDB
  • Contact Us

Morris Development

Custom System Development and Integration

July 23, 2016

Angular Routing Methods With Angular 2.0 in mind.

While the primary goal is to get things as easy to manage as possible, and as easy as possible to use the same code in multiple places, the underlying feeling is constantly that your systems will have to be converted to Angular 2.0 in a few years. You can’t get too worked up, saying you’re going to wait, because the first few versions of Angular 2 will have problems that you DO NOT want to run into on when you’ve got a system this big. Still, we all need to think ahead for cost-effective purposes.

Components will be a big deal. From what I understand, we’ll be able to run Angular 2.0 and Angular 1.5+ side by side. Since components are inherently isolated, we’ll be able to update components one by one without having to do a full site replace, or even the “Silo” replacement, like how we’ve broken up our most recent 350 webpage system.

Now, there is a component router 3rd party tool, and it’s very cool and people love it, however… we hear that the newer Angular standard router is going to be very good, so we haven’t been using component router.

So, how do you use components in a router? Well, there is an insanely simple “hack” that lets you do it and works just fine.

app.config(['$routeProvider', '$locationProvider',
  function ($routeProvider, $locationProvider) {
      //  console.log($routeProvider);
      $routeProvider
        .when('/', {
            template: ""
        })
          
          .when('/:inventory_id', {
              template: ""
          })
           .when('/:inventory_id/stocklist', {
               template: ""
           })
          .when 
      .otherwise({ redirectTo: '/' });
       
  }]);

It doesn’t get much simpler than that. You can inject variables and other validation as well, but this shows you just how simple you can start out when you are refactoring into components and preparing for Angular 2.0

Article by MacGyver / AngularJS, Web Developer

About MacGyver

I've worked with database systems for over 20 years, and started my own company in 2000. Almost all my business consists of internal database systems, either ERP or CRM. My programming is primarily in Angular / Microsoft C# and MS SQL.

About This Site

Morris Development has been specializing in internal database system design and integration since 1999. We provide long-term management and support of secure data systems for many businesses as well as developing the more complex code structures for ERP systems like Intellievent, Apidas, and AVMS.

This site is primarily for our developers to keep track up various technologies and updates that are used by Morris Development.

Training

Integrating Angular Microsite with .Net

Private Data Caching with Google Storage

Continuous Deployment for Production Releases?

Azure Websites – the perfect Angular host

Angular 2

  • Angular 2 Authentication
  • Angular Command Line Interface
  • Material Design for Angular
  • Using Observables in Angular 2

Mentors

  • Ben Nadel
  • Dan Wahlin
  • Deborah Kurata
  • John Papa

Staff

  • Dan Morris

Training

  • Google Development Courses
  • Microsoft Virtual Academy
  • PluralSight
  • Test Deep Links

© 2025 · Morris Development