![Oracle Drags Its Feet in the JavaScript Trademark Dispute](https://cdn.sanity.io/images/cgdhsj6q/production/919c3b22c24f93884c548d60cbb338e819ff2435-1024x1024.webp?w=400&fit=max&auto=format)
Security News
Oracle Drags Its Feet in the JavaScript Trademark Dispute
Oracle seeks to dismiss fraud claims in the JavaScript trademark dispute, delaying the case and avoiding questions about its right to the name.
A library that allows href to understand Angular's router while retaining its default functionality.
A library that allows href to understand Angular's router while retaining its default functionality.
router.navigate()
for internal link#
attributes and let you configure the scrolling logicrel="nooepener"
& target="_blank"
to external link if wished sohref
with the html button
attributeScroll when ready
mechanismanchor
npm install ngx-href
Inside your app.module.ts
file.
import { NgxHrefModule } from 'ngx-href'
imports: [
/** Default
* avoidSpam="false"
* behavior="auto"
* defaultOffset="0"
* navbarOffset="0"
* rel=undefined
* retryTimeout=undefined
* target="_self"
**/
NgxHrefModule.forRoot({}),
// Or
NgxHrefModule.forRoot({
avoidSpam: true,
behavior:"smooth",
defaultOffset:"30",
navbarOffset:"60",
rel:"noopener nofollow",
retryTimeout: 300,
target:"_blank",
}),
],
Nothing to do it should work out of the box
href
from the DOM from example@outlook.com
into example(at)outlook.com
Default: "auto"
Accepted value: ScrollBehavior
// ("auto" | "instant" | "smooth")
Can also be passed individually directly through html
<a href="https://my-external-url.com" behavior="instant">
The standard offset to be added to your website scrollTo
logic
Default: 0
Accepted value: number
Together with the navbarOffset
will be the total offset for the scroll.
An additional offset calculated base on your navbar height
Default: 0
Accepted value: number
Together with the defaultOffset
will be the total offset for the scroll.
You can update this value after the navbar is rendered.
<navbar #navbar>
<!-- My html code -->
</navbar>
@ViewChild('navbar', { static: true }) navbar: ElementRef
constructor(
private _ngxHrefService: NgxHrefService,
) {}
ngAfterContentInit(): void {
this._ngxHrefService.navbarOffset = this.navbar.nativeElement.offsetHeight
}
Default: undefined
Accepted value: number
Trigger a second scrollTo
event after retryTimeout
milliseconds.
Note: This should be avoided, prefer playing with skeleton and fixed height
Default: undefined
Accepted value: string
Can also be passed individually directly through html
<a href="https://my-external-url.com" rel="noopener nofollow">
Default: "_self"
Accepted value: string
Can also be passed individually directly through html
<a href="https://my-external-url.com" target="_blank">
Wherever you plan to use the href directive or pipe
import { NgxHrefDirective, ToAnchorPipe } from 'ngx-href'
imports: [
NgxHrefDirective,
ToAnchorPipe,
]
Then you can use it as you would normally use an a
element
Normal use
<!-- Angular router -->
<a href="/angular/router/link">
My internal link
</a>
<!-- Or with a button -->
<button href="/angular/router/link">
My internal link
</button>
<!-- External link -->
<a href="https://external-url.com">
An external link
</a>
<!-- Tel -->
<a href="tel:+41791112233">
+41791112233
</a>
<!-- Email -->
<a href="mailto:foobar@outlook.com">
foobar@outlook.com
</a>
<!-- Scroll -->
<a href="#myAnchor">
My scroll to anchor
</a>
<!-- Scroll in different page -->
<a href="/angular/router#link">
My internal link with anchor
</a>
The toAnchor
pipe let you
transform an element ot a correct anchor
example: my Title $%
will be transform to my-title
Emit that this anchor have been created, so that we can scroll to that element
<!-- Just transform the title to anchor like string-->
<div [id]="my Title $%"| toAnchor : false"> </div>
<!-- If an href has been previously triggered, scroll to this element -->
<div [id]="my Title $%"| toAnchor"> </div>
// foo.component.ts
import { NgxHrefService } from 'ngx-href'
// ...
constructor(public ngxHrefService: NgxHrefService) {}
Normal use
<button (click)="ngxHrefService.scrollTo(#myAnchor)">
Scroll to #myAnchor
</button>
<!-- some html -->
<h2 id="myAnchor">A title</h2>
FAQs
A library that allows href to understand Angular's router while retaining its default functionality.
The npm package ngx-href receives a total of 43 weekly downloads. As such, ngx-href popularity was classified as not popular.
We found that ngx-href demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 0 open source maintainers collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
Oracle seeks to dismiss fraud claims in the JavaScript trademark dispute, delaying the case and avoiding questions about its right to the name.
Security News
The Linux Foundation is warning open source developers that compliance with global sanctions is mandatory, highlighting legal risks and restrictions on contributions.
Security News
Maven Central now validates Sigstore signatures, making it easier for developers to verify the provenance of Java packages.