• Stars
    star
    161
  • Rank 233,470 (Top 5 %)
  • Language
    JavaScript
  • License
    MIT License
  • Created about 11 years ago
  • Updated over 5 years ago

Reviews

There are no reviews yet. Be the first to send feedback to the community and the maintainers!

Repository Details

A collection of useful Ember.js debugging functions.

Build Status

ember-devtools

A collection of useful functions for developing Ember apps. Best served from the console.

Usage

ember-devtools is an Ember.Service that is most useful when available in the devtools console. The simplest was access this from the console is using a global variable (eww!) which can be defined in config/environment.js.

var ENV = {
  'ember-devtools': {
    global: true,
    enabled: environment === 'development'
  }
}

Setting global will allow access to the devTools functions globally (eg. you can run routes() in the console). If you'd prefer these functions to be under a prefix set global: 'devTools' for devTools.routes().

The enabled option will enable the addon. By default, this addon will only be included in the development environment.

Alternatively you can use Ember.inject.service('ember-devtools') or appInstance.lookup('service:ember-devtools').

Functions

app([name])

Returns the named application. name defaults to main.

routes()

Returns the names of all routes.

route([name])

Returns the named route. name defaults to the current route.

router([name])

Returns the named router instance. name defaults to main.

model([name])

Returns the model for the named controller. name defaults to the the current route.

service(name)

Performs a lookup for the named service in the owner (using 'service:' + name).

controller([name])

Returns the named controller. name defaults to the current route.

log(promise[, property[, getEach]])

Resolves the promise and logs the resolved value using console.log. Also sets window.$E to the resolved value so you can access it in the dev tools console.

If property is specified then $E.get(property) will be logged.

If getEach is true then $E.getEach(property) will be logged.

Examples:

> log(store.find('organisation')) => undefined
> $E.get('length') => 3
> log(store.find('organisation'), 'length') => 3
> log(store.find('organisation'), 'name', true) => array of names

lookup(name)

Performs a lookup for the named entry in the owner, which will in turn ask its resolver if it's not found.

resolveRegistration(name)

Performs a lookup for the named factory in the registry.

ownerNameFor(obj)

Searches the owner to find the name for the specified object (if any).

inspect

Does what it says, in a manner of speaking. Alias to Ember.inspect.

logResolver(bool = true)

Switch logging for the resolver on or off.

logAll(bool = true)

Switch logging for all the things on/off.

logRenders()

Logs the rendering duration (in milliseconds) of each component, view and helper.

globalize()

Attach all of these useful functions to the window object (eww!) - useful for accessing in the console.

getOwner(obj = this)

The owner of the service or specified obj.

config()

Returns the Application config

Properties

owner

The owner of the service. n.b. this is not globalised (to avoid conflict with window.owner), use getOwner() instead.

store

The Ember Data Store.

typeMaps

The Ember Data 'type map'.

Installation

Ember CLI

npm install ember-devtools --save-dev

Upgrading From v2.0

ember-devtools is now dependent on ember-cli.

Changelog

  • v6: container and containerNameFor are now owner and ownerNameFor

More Repositories

1

jquery-bonsai

Super lightweight jQuery tree plugin
JavaScript
148
star
2

tabcordion

A jQuery plugin that transforms Bootstrap tabs to an accordion and vice versa. Useful for responsive mobile sites.
CoffeeScript
91
star
3

lugg

A simple logging module that uses bunyan for logging and debug output with inspiration from @tj's debug.
JavaScript
38
star
4

jquery-qubit

Provides the semantics for a nested list of tri-state checkboxes, using the HTML5 "indeterminate" property
JavaScript
18
star
5

factory-girl-sequelize

A Sequelize adapter for factory-girl
JavaScript
11
star
6

jquery-json-list

A simple plugin to create a nested list from a JSON document.
JavaScript
10
star
7

factory-girl-bookshelf

A Bookshelf adapter for factory-girl
JavaScript
8
star
8

ember-spin.js

An Ember.js component for displaying a spinning loading indicator using spin.js.
JavaScript
6
star
9

silverstripe-hide-email

A SilverStripe module that provides Javascript email obfuscation with a <noscript> fallback option
PHP
4
star
10

ember-cli-jstransform

An ember-cli addon for applying jstransform transformations, such as transpiling ES6 to ES5
JavaScript
3
star
11

ember-pager

Scrolling and link-based pagination for Ember.js
CoffeeScript
3
star
12

ember-orchestrate.io

An Ember Data adapter for Orchestrate.io
JavaScript
3
star
13

git-tools

Some useful git scripts, including scripts to automate standard git-flow hotfix and release workflows.
Python
3
star
14

select-transformer

Transforms HTML select elements into groups of radio buttons or checkboxes
JavaScript
2
star
15

broccoli-jstransform

Broccoli plugin for jstransform
JavaScript
2
star
16

setlist.io

PHP
1
star
17

list-filter.js

A simple plugin to filter a list of items based on an input field.
JavaScript
1
star
18

ember-todomvc

A todo app written in Ember.js using ember-orchestrate.io
JavaScript
1
star
19

simplecart-utils

A set of tools for SimpleCart.js
JavaScript
1
star
20

silverstripe-soundcloud-player

A SoundCloud player module for SilverStripe CMS.
JavaScript
1
star
21

jquery-hover-zoom

Tiny little jQuery plugin that zooms images on hover. Uses jQuery.Transit to handle the animation.
1
star
22

jquery-equal-height

Very simple jQuery plugin that makes DOM elements have the same height. Usage via JavaScript or data attributes.
CoffeeScript
1
star
23

ember-select-transformer

A simple little ember-cli addon that adds a {{select-transformer}} component to your Ember app.
JavaScript
1
star