Skip to content

Instantly share code, notes, and snippets.

@mjuniper
Last active October 12, 2018 16:45
Show Gist options
  • Save mjuniper/566eb0e180a20a9f96a22578abf614d2 to your computer and use it in GitHub Desktop.
Save mjuniper/566eb0e180a20a9f96a22578abf614d2 to your computer and use it in GitHub Desktop.
Error route model with reject from model hook
import Ember from 'ember';
export default Ember.Controller.extend({
appName: 'Ember Twiddle'
});
import Ember from 'ember';
export default Ember.Route.extend({
model () {
return Ember.RSVP.reject('fetching the model failed');
}
});
<h1>Error: {{model}}</h1>
<h2>Shouldn't it be "fetching the model failed"?</h2>
<h1>Welcome to {{appName}}</h1>
<br>
<br>
{{outlet}}
<br>
<br>
{
"version": "0.12.1",
"EmberENV": {
"FEATURES": {}
},
"options": {
"use_pods": false,
"enable-testing": false
},
"dependencies": {
"jquery": "https://cdnjs.cloudflare.com/ajax/libs/jquery/1.11.3/jquery.js",
"ember": "2.18.0",
"ember-template-compiler": "2.18.0",
"ember-testing": "2.18.0"
},
"addons": {
"ember-data": "2.12.1"
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment