Ember Data Mockjax

by alexspeller

HTML

<script src="http://cdnjs.cloudflare.com/ajax/libs/jquery-mockjax/1.5.2/jquery.mockjax.js"></script>
<script src="http://ember.alexspeller.com/handlebars-1.0.0.js"></script>
<script src="http://ember.alexspeller.com/ember-latest.js"></script>
<script type="text/x-handlebars">
    {{outlet}}
</script>
<script type="text/x-handlebars" data-template-name="index">
    {{#link-to "other"}}Other{{/link-to}}
</script>
<script type="text/x-handlebars" data-template-name="other">
    <a href="#" {{action "slideThenTransition" target="view"}}>Back</a>
</script>

CSS

.other-view {
    padding: 1em;
    border: 1px solid black;
}

CoffeeScript

window.App = Em.Application.create()

App.Router.map ->
  @route "other"
    
App.OtherView = Em.View.extend
  classNames: 'other-view'
  slideThenTransition: ->
    @$().slideUp =>
       @controller.transitionToRoute 'index'