@hettiger/ngx-fragment-link-faker
Advanced tools
Comparing version 0.1.1 to 0.1.2
<!-- CHANGELOGGER --> | ||
## [v0.1.2] - 2022-09-24 | ||
### Other (1 change) | ||
- Document behavior on various router extra options | ||
## [v0.1.1] - 2022-02-14 | ||
@@ -4,0 +11,0 @@ |
@@ -13,3 +13,3 @@ { | ||
], | ||
"version": "0.1.1", | ||
"version": "0.1.2", | ||
"author": { | ||
@@ -16,0 +16,0 @@ "name": "Martin Hettiger", |
@@ -105,2 +105,30 @@ # NgxFragmentLinkFaker | ||
## Router Extra Options | ||
Anchor scrolling may not work when you enable `scrollPositionRestoration` on the `RouterModule`. | ||
Make sure to also enable the `anchorScrolling` option and set an appropriate `scrollOffset`. | ||
> I.e. if you use `scrollTopDelta: 64` or `[mhScrollTopDelta]="64"` set `scrollOffset` to `[0, 64]`. | ||
```typescript | ||
@NgModule({ | ||
imports: [RouterModule.forRoot(routes, { | ||
scrollPositionRestoration: 'enabled', | ||
anchorScrolling: 'enabled', | ||
scrollOffset: [0, 64], | ||
})], | ||
exports: [RouterModule] | ||
}) | ||
export class AppRoutingModule { | ||
} | ||
``` | ||
In addition to these extra options you optionally need the following global styles for smooth scroll support: | ||
```css | ||
html { | ||
scroll-behavior: smooth; | ||
} | ||
``` | ||
## Demo application | ||
@@ -107,0 +135,0 @@ |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
47138
184