ViewTargetActionSupport

Ember.ViewTargetActionSupport Class PRIVATE Extends: Ember.TargetActionSupport Defined in: packages/ember-views/lib/mixins/view_target_action_support.js:5 Module: ember Ember.ViewTargetActionSupport is a mixin that can be included in a view class to add a triggerAction method with semantics similar to the Handlebars {{action}} helper. It provides intelligent defaults for the action's target: the view's controller; and the context that is sent with the action: the view's context. Note: In n

Using Block Params

Using Block Params Components can have properties passed in (Passing Properties to a Component), but they can also return output to be used in a block expression. Return values from a component with yield app/templates/index.hbs {{blog-post post=model}} app/templates/components/blog-post.hbs {{yield post.title post.body post.author}} Here an entire blog post model is being passed to the component as a single component property. In turn the component is returning values using yield. In this

Troubleshooting

Troubleshooting Below are some common issues you may encounter when using the Inspector, along with the necessary steps to solve them. If your issue is not listed below, please submit an issue to the Inspector's GitHub repo. Ember Application Not Detected If the Inspector cannot detect an Ember application, you will see the following message: Some of the reasons this may happen: This is not an Ember application You are using an old Ember version ( < 1.0 ). You are using a protocol other t

Unit Testing Basics

Unit Testing Basics Unit tests are generally used to test a small piece of code and ensure that it is doing what was intended. Unlike acceptance tests, they are narrow in scope and do not require the Ember application to be running. As it is the basic object type in Ember, being able to test a simple Ember.Object sets the foundation for testing more specific parts of your Ember application such as controllers, components, etc. Testing an Ember.Object is as simple as creating an instance of th

Triggering Changes with Actions

Triggering Changes with Actions You can think of a component as a black box of UI functionality. So far, you've learned how parent components can pass attributes in to a child component, and how that component can use those attributes from both JavaScript and its template. But what about the opposite direction? How does data flow back out of the component to the parent? In Ember, components use actions to communicate events and changes. Let's look at a simple example of how a component can us

Transition#trigger()

trigger (ignoreFailure, name) public Defined in bower_components/router.js/lib/router/transition.js:248 Fires an event on the current list of resolved/resolving handlers within this transition. Useful for firing events on route hierarchies that haven't fully been entered yet. Note: This method is also aliased as send Parameters: ignoreFailure [Boolean] a boolean specifying whether unhandled events throw an error name String the name of the event to fire

Transition#then()

then (onFulfilled, onRejected, label) Promisepublic Defined in bower_components/router.js/lib/router/transition.js:135 A standard promise hook that resolves if the transition succeeds and rejects if it fails/redirects/aborts. Forwards to the internal promise property which you can use in situations where you want to pass around a thennable, but not the Transition itself. Parameters: onFulfilled Function onRejected Function label String optional string for labeling the promise. Us

Transition#retry()

retryTransitionpublic Defined in bower_components/router.js/lib/router/transition.js:207 Retries a previously-aborted transition (making sure to abort the transition if it's still active). Returns a new transition that represents the new attempt to transition. Returns: Transition new transition

Transition#promise

promise{Object}public Defined in bower_components/router.js/lib/router/transition.js:108 The Transition's internal promise. Calling .then on this property is that same as calling .then on the Transition object itself, but this property is exposed for when you want to pass around a Transition's promise, but not the Transition object itself, since Transition object can be externally aborted, while the promise cannot.

Transition#followRedirects()

followRedirectsPromisepublic Defined in bower_components/router.js/lib/router/transition.js:272 Transitions are aborted and their promises rejected when redirects occur; this method returns a promise that will follow any redirects that occur and fulfill with the value fulfilled by any redirecting transitions that occur. Returns: Promise a promise that fulfills with the same value that the final redirecting transition fulfills with