
Security News
Deno 2.2 Improves Dependency Management and Expands Node.js Compatibility
Deno 2.2 enhances Node.js compatibility, improves dependency management, adds OpenTelemetry support, and expands linting and task automation for developers.
ember-custom-link
Advanced tools
ember-custom-link
is an Ember addon which allows you to pass attributes to the ember-custom-link
component that
determine whether the component is an internal link, using {{#link-to}}
, or an external link using href
.
It may be combined with a custom Ember helper that you would make such as this:
app\helpers\is-hyperlink-component.js
import { helper } from '@ember/component/helper';
export function isHyperlinkComponent([key]) {
if (key === "custom-link") return "ember-custom-link";
}
export default helper(isHyperlinkComponent);
Which is then combined with the helper in a parent component such as this:
app\templates\components\open-pr-body.hbs
{{#each data.copyPreview as |paragraph|}}
<p>
{{#each paragraph as |paragraph|}}
{{#each-in paragraph as |key value|}}
{{#if (is-hyperlink-component key value)}} {{!-- THE NEXT THREE LINES ARE THE SIGNIFICANT PORTION --}}
{{component key data=value}}
{{/if}}
{{/each-in}}
{{/each}}
</p>
{{/each}}
Or it can be used on it's own with its required attributes being passed as properties.
hasTarget
-> Should be true
unless using "mailto"
where there is no desire to open a linked document.href
-> To be included if your link is external and is a String representing the href
attribute you want in your template.linkTo
-> To be included if your link is internal and is a String representing the link-to
route you want in your template.isFollowedBy
-> Should be false
unless you want a character such as ,
or .
to immediately follow your custom link.text
-> A String representing the actual hypertext you want to appear on the page.{{#link-to}}
component with the hypertext followed by whitespace{
"custom-link": {
hasTarget: true,
linkTo: "index",
isFollowedBy: false,
text: "THIS IS MY SITE NAME"
}
}
{
"custom-link": {
hasTarget: true,
href: "https://www.<SITENAME>.com",
isFollowedBy: false,
text: "THIS IS MY SITE NAME"
}
}
{
"custom-link": {
hasTarget: true,
href: "https://www.<SITENAME>.com",
isFollowedBy: ",",
text: "THIS IS MY SITE NAME"
}
}
mailto:
requiring hasTarget: false
{
"custom-link": {
hasTarget: false,
href: "mailto:myName@mySite.com",
isFollowedBy: false,
text: "myName@mySite.com"
}
}
ember install ember-custom-link
git clone <repository-url>
cd ember-custom-link
npm install
npm run lint:js
npm run lint:js -- --fix
ember test
– Runs the test suite on the current Ember versionember test --server
– Runs the test suite in "watch mode"ember try:each
– Runs the test suite against multiple Ember versionsember serve
For more information on using ember-cli, visit https://ember-cli.com/.
This project is licensed under the MIT License.
FAQs
The default blueprint for ember-cli addons.
We found that ember-custom-link demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer 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
Deno 2.2 enhances Node.js compatibility, improves dependency management, adds OpenTelemetry support, and expands linting and task automation for developers.
Security News
React's CRA deprecation announcement sparked community criticism over framework recommendations, leading to quick updates acknowledging build tools like Vite as valid alternatives.
Security News
Ransomware payment rates hit an all-time low in 2024 as law enforcement crackdowns, stronger defenses, and shifting policies make attacks riskier and less profitable.