This time I will bring you Angular RouterLink to make different fancy jumps. What are the precautions for Angular RouterLink to make fancy jumps? The following is a practical case, let's take a look.
Preface
In addition to using Router's navigate() method to switch routes, Angular2 also provides a command to convert aDOM Object is enhanced as a routing entry:
@View({ directives:[RouterOutlet,RouterLink] template : `<nav> <b router-link="video">video</b> | <b router-link="music">music</b> </nav> <router-outlet></router-outlet>` })
event monitoring to the host DOM object, and calls Router's navigate() method for routing when triggered.
However, this article mainly introduces the relevant content about Angular’s RouterLink fancy jump. It is shared for everyone’s reference and study. I won’t say much below, let’s take a look at the detailed introduction.routerLink itself supports two writing methods:
<a routerLink="detail"> </a> <a [routerLink]="['detail']"> </a>
`http://localhost:4200/#/doc/license`
Writing method 1: Absolute path / route name
<!--跳到 http://localhost:4200/#/doc/license --> <a [routerLink]="['/doc/demo']" >跳呀跳</a> <!--跳到 http://localhost:4200/#/demo --> <a [routerLink]="['/demo']" >跳呀跳</a>
Writing 2: A routing name routing name
<a [routerLink]="['demo']" >跳呀跳</a>
Writing method 3: relative path../route name
<a [routerLink]="['../demo']" >跳呀跳</a>
Writing method 4: ./route name, that is, the current route you wrote to jump to the route
<a [routerLink]="['./demo']" >跳呀跳</a>
Detailed explanation of the steps to implement snowflake falling animation in JS
How to implement the port reuse function in Node.Js
The above is the detailed content of Angular+RouterLink makes different fancy jumps. For more information, please follow other related articles on the PHP Chinese website!