Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Angular CLI route

Tags:

When executing command:

ng generate route someName

I am getting error like this:

Could not start watchman; falling back to NodeWatcher for file system events. Visit http://ember-cli.com/user-guide/#watchman for more info. Due to changes in the router, route generation has been temporarily disabled. You can find more information about the new router here: http://victorsavkin.com/post/145672529346/angular-router

Provided links are not helpful

like image 843
bensiu Avatar asked Jul 12 '16 20:07

bensiu


People also ask

What is the command for routing in Angular?

The forRoot() method supplies the service providers and directives needed for routing, and performs the initial navigation based on the current browser URL. Next, AppRoutingModule exports RouterModule to be available throughout the application.

What is routing in Angular with example?

A route definition is a JavaScript object. Each route typically has two properties. The first property, path , is a string that specifies the URL path for the route. The second property, component , is a string that specifies what component your application should display for that path.

Do I need Angular routing?

At the basic level, routing allows angular to display different "pages" or components. You probably want to have it, if you want to navigate across pages in your application. It shouldn't hurt anything if you add it, but don't use it.


1 Answers

use :

ng g m route --routing
  • g-> generate
  • m-> module
  • route-> Your route Module Name(You can use any name).
like image 134
Deepak swain Avatar answered Oct 23 '22 11:10

Deepak swain