-
Notifications
You must be signed in to change notification settings - Fork 12k
Due to changes in the router, route generation has been temporarily disabled. #1093
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Comments
+1 |
same here |
This message is correct and intended as of beta.6. The motivation for this was as follows:
We felt we wouldn't be doing our users any favors by encouraging the use of We're working to re-add router functionality as fast as possible but I don't have a date for it. |
To add on to what @filipesilva stated above...
|
Waiting... |
+1 |
1 similar comment
+1 |
waiting.. |
Let me see if I can help clarify something. @Brocco @filipesilva Based on your comments I get the impression that it may be more on the order of weeks rather than days until we have route generation capabilities again. Do you think this would be about the right expectation? I'm not saying this to complain, I just want to have a feel for what to expect. |
@jasonswett I'll try to clarify as best I can. We have no idea if route generation will be returning let alone when. The best practices for routing from the style guide are being put together right now. Once they are done with that we will take a look and see if the CLI can/should assist with route generation. Routes are disconnected from components now, and we want to ensure that anything that is added to the CLI will be beneficial for the users. Route definitions are rather straightforward IMO now so I would not be surprised if |
I have a somewhat different take on this... more predictive in nature:
|
@Brocco in lieu of a generator could you provide a loose step by step for manually changing an angular-cli app to use the new routing? Something like
That would be very helpful. Thanks. |
I am not up to date but wasn't there a command that you all talked about |
I'm guessing here, but I'd wager the ng upgrade will be available for angular2 final. |
This brings up perhaps a good point. I'm not used to the functionality of libraries disappearing even though I haven't upgraded my library version. Wouldn't it be more "normal" to allow I had written a number of tutorials that depended on |
Exactly! I mean we could have just used "ng route" till it's deprecation. On 22 Jun 2016 7:27 p.m., "Jason Swett" notifications@github.com wrote:
|
have there been any updates on this? |
I understand that the router is evolving quickly, and that the CLI is supposed to uphold best practices, and therefore does not want to lead people down the wrong path by letting people generate routes in a fashion that is likely to be changed soon. But all I want to know is: If we can't automatically generate routes, I'd be happy to manually create them, but I can't seem to find any tutorials. Could anybody point me in the right direction? |
The current published angular.io Router docs cover the "3" router. |
@kylecordes I'm sorry, I assumed that they were wrong because they weren't working in an angular-cli app I am developing. But I just went back and checked, and the problem is that my app is not on the 3 router! My bad, it's fine now... |
Any progress/updates on this? |
Waiting for this. |
is there an existing issue reference for the current routing style guide? |
I make it short: any generator without the ability to create routes is USELESS! A route means at least
You have to do all of them manually, that is too much work! John Papa's great NG2-Snippets unfortunately do not help here,.. |
1-6 are still done by the cli? |
@jffry @yusijs the official docs also have updated chapters for the new router, and they're being kept up to date with each release:
|
@filipesilva I'm aware, I was answering @webia1 :) |
Currently starting with a big AngularJS 2 application (100+ unique pages) So i need to create 100 routes ;) What is the approach the Angular CLI is doing? Put the routes per route-component or a routes.ts file? |
Right now Angular CLI isn't generating routes. I don't exactly how it will implement routes when route generation comes back. The official Angular docs I've seen seem to want you to put your routes all in one file specifically dedicated to routes. I've pasted below a route file from an app I'm working on in case it's helpful to see an example. // src/app/app.routes.ts
import { provideRouter, RouterConfig } from '@angular/router';
import { BookListComponent } from './book-list';
import { NewBookComponent } from './new-book';
import { EditBookComponent } from './edit-book';
const routes: RouterConfig = [
{ path: '', component: BookListComponent },
{ path: 'new-book', component: NewBookComponent },
{ path: 'edit-book/:id', component: EditBookComponent }
];
export const appRouterProviders = [
provideRouter(routes)
]; (Any further discussion is probably more appropriately had in some other place.) |
Guideline should be put on readme file, for how to use route without generator for temporarily. when |
Any updates on this? Is this feature currently available in master and/or are you planning on enabling it for the next version of CLI that will be switching to RC6? I'm trying to figure out if I should wait some more, if I should just follow the guidelines in your doc and start redoing my deprecated router routes manually or if I should switch to master in case rc6 support and route generation are already enabled there. Shedding some light on this route generation business would be highly appreciated! |
Current status on master: adding of routes is still a manual process. But when you generate a module via |
Thanks for the update, @Brocco ! |
Hi, @Brocco, @radoslavpetranov, I still have no idea how to do routing, I tried this, but no magic, can you give an real case example, thanks |
ng generate module some-feature --routing is correct. If you change to the directory some-feature-routing.module.ts
some-feature.component.css
some-feature.component.html
some-feature.component.spec.ts
some-feature.component.ts
some-feature.module.ts and in the file import { NgModule } from '@angular/core';
import { Routes, RouterModule } from '@angular/router';
const routes: Routes = [];
@NgModule({
imports: [RouterModule.forChild(routes)],
exports: [RouterModule],
providers: []
})
export class SomeFeatureRoutingModule { } You see this information in every module, instead of modifying a central file for routing like in Angular2-Seed from MGechev. That's a kind of "using a sledge-hammer to crack a nut",.. I wonder, why not learning from one another?? |
@Brocco can we please remove the route generator completely? Or change the message to say use Cheers, |
Current status of route generation: You can generate routing modules on new app creation and on module generation using the flag |
@Brocco we probably should change this message into something that explains this instead. Something along the lines of:
Happy to send a PR if the copy is OK, or to use alternative suggested copy. Cheers, |
@Meligy A PR with that update would be great! |
@Brocco shouldn't be the online documentation updated about that? |
|
any status on this PR? @Meligy ? |
@RaphHaddad I have updated the README in #3983 and the PR has been approved, so it should be merged soon. For now, you can review the updated docs here: https://github.com/Meligy/angular-cli/blob/b391ef8811b0e6c0a3b549708764f814bf860d12/README.md#generating-a-route |
@RaphHaddad actually it's already cherry picked into master, you can review the newest README from the official repository here https://github.com/angular/angular-cli#generating-a-route |
Should we use https://angular.io/docs/ts/latest/guide/router.html or https://github.com/angular/angular-cli#generating-a-route |
please give us some idea of a release date - thanks |
@valerianmenin If I'm not mistaken, cli is using the ff https://angular.io/docs/ts/latest/guide/router.html#!#routing-module |
Specific route generation is not on the roadmap going forward, you can get started with routing by specifying I am locking this thread, if you have issues with what is currently being generated please open a new issue. |
When about it will be available again?
The text was updated successfully, but these errors were encountered: