๐Ÿ“ฆ ctcpip / ember-kns-helpers

Provides additional helpers for Kinesis' apps.

โ˜… 0 stars โ‘‚ 0 forks ๐Ÿ‘ 0 watching โš–๏ธ MIT License
๐Ÿ“ฅ Clone https://github.com/ctcpip/ember-kns-helpers.git
HTTPS git clone https://github.com/ctcpip/ember-kns-helpers.git
SSH git clone git@github.com:ctcpip/ember-kns-helpers.git
CLI gh repo clone ctcpip/ember-kns-helpers
David Nettle David Nettle Bump to v1.0.4 b555e89 7 years ago ๐Ÿ“ History
๐Ÿ“‚ master View all commits โ†’
๐Ÿ“ addon
๐Ÿ“ app
๐Ÿ“ config
๐Ÿ“ test-support
๐Ÿ“ tests
๐Ÿ“ vendor
๐Ÿ“„ .bowerrc
๐Ÿ“„ .editorconfig
๐Ÿ“„ .ember-cli
๐Ÿ“„ .eslintrc.js
๐Ÿ“„ .gitignore
๐Ÿ“„ .gocd.yaml
๐Ÿ“„ .jscsrc
๐Ÿ“„ .npmignore
๐Ÿ“„ .tmuxinator.yml
๐Ÿ“„ .travis.yml
๐Ÿ“„ .watchmanconfig
๐Ÿ“„ ember-cli-build.js
๐Ÿ“„ index.js
๐Ÿ“„ LICENSE.md
๐Ÿ“„ package.json
๐Ÿ“„ README.md
๐Ÿ“„ testem.js
๐Ÿ“„ yarn.lock
๐Ÿ“„ README.md

ember-kns-helpers

Greenkeeper badge npm Version Ember Observer Score

Provides additional helpers for Kinesis' apps.

Available helpers

Usage

Truth helpers

is-present

Uses built in Ember.isPresent to check for presence.

{{#if (is-present someProp)}}
{{/if}}
โฌ†๏ธ back to top

deep-equal

Checks if two arrays contain the same items irrespective of what order they are in each array. Useful for the All in a checkbox list.

{{input
  type="checkbox"
  checked=(deep-equal checkedYears organisationYears)}}
โฌ†๏ธ back to top

Format helpers

format-blank

Shows the value is present, otherwise replaces it with default - or optionally provided replacement.

{{! Shows the default "-"}}
{{format-blank undefined}}

{{! Use something other than the default.}}
{{format-blank undefined "NA"}}
โฌ†๏ธ back to top

format-boolean

Shows Yes/No for booleans.

{{format-boolean flag}}
โฌ†๏ธ back to top

format-increment

Simply adds 1 to a number. Useful for showing collection indicies.

{{format-increment index}}
โฌ†๏ธ back to top

format-percentage

Converts a decimal percentage to a human readable percentage.

{{! Shows 10% }}
{{format-percentage 0.10}}
โฌ†๏ธ back to top

Array helpers

index-of

Returns the index of an object in an array.

{{index-of item array}}
โฌ†๏ธ back to top

Development

To link your local package during development:

  • Go to the package directory and create a globally-installed symbolic link
  • cd ~/Code/ember-kns-helpers/
  • npm link
  • Go to the project directory and create a symlink from the local node_modules folder to the global symlink.
  • cd ~/Code/project/
  • npm link ember-kns-helpers
To unlink the local package:

  • Unlink in the project directory
  • npm unlink ember-kns-helpers
  • Reinstall
  • npm install

License

ember-kns-helpers is MIT Licensed.