Research
Security News
Quasar RAT Disguised as an npm Package for Detecting Vulnerabilities in Ethereum Smart Contracts
Socket researchers uncover a malicious npm package posing as a tool for detecting vulnerabilities in Etherium smart contracts.
ember-cli-document-title
Advanced tools
This addon adds sane document.title integration to your ember app. All does is include this gist by @machty to your application.
Install by running
npm install ember-cli-document-title
This adds two new keys to your routes:
titleToken
title
They can be either strings or functions.
Every time you transition to a route, the following will happen:
titleToken
s from your leafmost route and
bubble them up until it hits a route that has title
defined.
titleToken
is the name of the route's model by default.title
is a string, that will be used as the document titletitle
is a function, the collected titleToken
s will be passed
to it in an array.title
function is used as the document
title.If you just put strings as the title
for all your routes, that will be
used as the title for it.
// routes/posts.js
export default Ember.Route.extend({
title: "Our Favorite posts!"
});
// routes/post.js
export default Ember.Route.extend({
title: "Please enjoy this post"
});
Let's say you want something like "Posts - My Blog", with "- My Blog" being static, and "Posts" being something you define on each route.
// routes/posts.js
export default Ember.Route.extend({
titleToken: "Posts"
});
This will be collected and bubble up until it hits the Application Route
// routes/application.js
export default Ember.Route.extend({
title: function(tokens) {
return tokens.join(' - ') + ' - My Blog';
}
});
In this example, we want something like "Name of current post - Posts - My Blog".
Let's say we have this object as our post-model:
Ember.Object.extend({
name: "Ember is Omakase"
});
And we want to use the name of each post in the title.
// routes/post.js
export default Ember.Route.extend({
titleToken: function(model) {
return model.get('name');
}
});
This will then bubble up until it reaches our Posts Route:
// routes/posts.js
export default Ember.Route.extend({
titleToken: "Posts"
});
And continue to the Application Route:
// routes/application.js
export default Ember.Route.extend({
title: function(tokens) {
return tokens.join(' - ') + ' - My Blog';
}
});
This will result in these titles:
0.0.1
FAQs
Adding document title functionality to your ember app
The npm package ember-cli-document-title receives a total of 1,731 weekly downloads. As such, ember-cli-document-title popularity was classified as popular.
We found that ember-cli-document-title demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 3 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.
Research
Security News
Socket researchers uncover a malicious npm package posing as a tool for detecting vulnerabilities in Etherium smart contracts.
Security News
Research
A supply chain attack on Rspack's npm packages injected cryptomining malware, potentially impacting thousands of developers.
Research
Security News
Socket researchers discovered a malware campaign on npm delivering the Skuld infostealer via typosquatted packages, exposing sensitive data.