String helpers for Ember. Extracted from the great DockYard's ember-composable-helpers.
To install:
ember install ember-cli-string-helpers
If you don't need all the helpers, you can specify which to whitelist or blacklist using only
or except
within your ember-cli-build.js
:
module.exports = function(defaults) {
var app = new EmberApp(defaults, {
'ember-cli-string-helpers': {
only: ['dasherize', 'underscore'],
except: ['titleize', 'capitalize']
}
});
};
Both only
and except
can be safely used together (the addon computes the diff), although it's best if you only use one for your own sanity.
except: ['camelize'] // imports all helpers except `camelize`
only: ['camelize'] // imports only `camelize`
camelize
capitalize
classify
dasherize
html-safe
humanize
lowercase
titleize
trim
truncate
underscore
uppercase
w
camelize
Camelizes a string using Ember.String.camelize
.
Output: helloJimBob
capitalize
Capitalizes a string using Ember.String.capitalize
.
Output: Hello jim bob
classify
Classifies a string using Ember.String.classify
.
Output: HelloJimBob
dasherize
Dasherizes a string using Ember.String.dasherize
.
Output: whats-that
html-safe
Mark a string as safe for unescaped output with Ember templates using Ember.String.htmlSafe
.
humanize
Removes dashes and underscores from a string, capitalizes the first letter and makes the rest of the string lower case.
Output: Some string
lowercase
Lowercases a string.
Output: people person's paper people
titleize
Capitalizes every word separated by a white space or a dash.
Output: My Big Fat Greek Wedding
trim
Trim a string.
Output: Lorem ipsum dolor sit amet, consectetur adipiscing elit.
truncate
Truncates a string with a characterLimit and optionally adds an ellipsis to the end.
Output: Lorem ipsum dolor...
underscore
Underscores a string using Ember.String.underscore
.
Output: whats_that
uppercase
Uppercases a string.
Output: LOUD NOISES
w
Splits a string on whitespace and/or turns multiple words into an array.
or:
See also: Ember w
documentation
Ember CLI 是一个 Ember.js 命令行工具,提供了由 broccoli 提供的快速的资源管道和项目结构。 Ember CLI 基于 Ember App Kit Project 目前已经废弃。 Assets Compilation Ember CLI asset compilation is based on broccoli. Broccoli has support for: Ha
This repository is no longer maintained. As a replacement check out: https://github.com/sir-dunxalot/ember-tooltips Ember CLI Tooltipster An Ember CLI add-on that wraps Tooltipster into an ember compo
ember-cli-updater This ember-cli addon helps you update your ember-cli application or addon. The idea of this addon is to automate some parts of the upgrade process so it's simplified. Not every chang
Ember-cli-yadda This Ember CLI addon facilitates writing BDD tests in the Gherkin language and executing them against your Ember app. @mschinis (Micheal Schinis) Did a great talk at @emberlondon BDD a
Ember-cli-simditor Ember component wrapper for simditor. Changes 0.0.7 Different from previous version, you must wrap content in object. See issue 6 for why. Getting Started Installation In your ember
ember-cli-chai Chai assertions for Ember.js. Deprecated This package is deprecated. Please use ember-auto-import to use chai and chai plugins directly. If you'd like to use chai, or were previously us