angular-cli icon indicating copy to clipboard operation
angular-cli copied to clipboard

404 Error trying to import @angular/router-deprecated

Open csquillen opened this issue 10 years ago • 6 comments

Looking at the Angular docs, I just noticed the beta router is deprecated. The app created by this CLI uses the new router package. Is there any documentation for the new router?

I tried using the old router by npm installing @angular/router-deprecated and importing as follows:

import { ROUTER_DIRECTIVES, RouteConfig } from '@angular/router-deprecated';

But I am getting the following error:

zone.js:461 Unhandled Promise rejection: Error: XHR error (404 Not Found) loading http://localhost:4200/vendor/@angular/router-deprecated

csquillen avatar May 06 '16 01:05 csquillen

Did you npm install @angular/router-deprecated?

hansl avatar May 06 '16 20:05 hansl

The beta Router is no longer supported by CLI. It's replaced by the rc1 Router. You should switch to using this one, instead of using the deprecated Router!

percy1984 avatar May 06 '16 22:05 percy1984

@cquillen2003 try this https://github.com/angular/angular-cli/pull/674 @hansl I've just opened a PR if you want

guillaumeleone avatar May 07 '16 10:05 guillaumeleone

I found an example app using the new router so I'm using it now. I mostly had to change my @RouteConfig entries to @Routes to get it working. No need to support the deprecated router from my end.

csquillen avatar May 07 '16 20:05 csquillen

what is the angular module name which support routes? @cquillen2003

omeryounus avatar Aug 02 '16 18:08 omeryounus

This issue has been automatically locked due to inactivity. Please file a new issue if you are encountering a similar or related problem.

Read more about our automatic conversation locking policy.

This action has been performed automatically by a bot.