mirror of
https://github.com/ionic-team/ionic-framework.git
synced 2026-03-13 10:22:08 +08:00
fix(angular): routerLink directives can be used (#28282)
This commit is contained in:
@@ -1,21 +1,19 @@
|
||||
import { Component } from '@angular/core';
|
||||
import { Directive } from '@angular/core';
|
||||
import {
|
||||
RouterLinkDelegateDirective as RouterLinkDelegateBase,
|
||||
RouterLinkWithHrefDelegateDirective as RouterLinkHrefDelegateBase,
|
||||
} from '@ionic/angular/common';
|
||||
|
||||
@Component({
|
||||
// eslint-disable-next-line @angular-eslint/component-selector
|
||||
@Directive({
|
||||
selector: ':not(a):not(area)[routerLink]',
|
||||
template: '<ng-content></ng-content>',
|
||||
standalone: true,
|
||||
})
|
||||
// eslint-disable-next-line @angular-eslint/directive-class-suffix
|
||||
export class IonRouterLink extends RouterLinkDelegateBase {}
|
||||
|
||||
@Component({
|
||||
// eslint-disable-next-line @angular-eslint/component-selector
|
||||
@Directive({
|
||||
selector: 'a[routerLink],area[routerLink]',
|
||||
template: '<ng-content></ng-content>',
|
||||
standalone: true,
|
||||
})
|
||||
// eslint-disable-next-line @angular-eslint/directive-class-suffix
|
||||
export class IonRouterLinkWithHref extends RouterLinkHrefDelegateBase {}
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
<a routerLink="/standalone/popover">
|
||||
<a routerLink="/standalone/popover" routerDirection="root">
|
||||
I'm a link
|
||||
</a>
|
||||
<button routerLink="/standalone/popover">
|
||||
<button routerLink="/standalone/popover" routerDirection="root">
|
||||
I'm a button
|
||||
</button>
|
||||
|
||||
Reference in New Issue
Block a user