App.Router.map ->
@resource "sentences", ->
@resource "sentence",
path: ":sentence_id", ->
App.Sentence = DS.Model.extend(
subject: DS.attr("string")
)
http://localhost:3000/#/sentences/5
If your server sends a 404, for such a request, Ember will raise an exception which can be handled via an errors
handler on the route. From there you can display this in the UI or transitionTo
another route that can display the error.
App.PostRoute = Ember.Route.extend({
events: {
error: function(reason, transition) {
// display error or transitionTo here
}
}
});
how to use the two params 'reason', 'transition'
Is it possible to show one example
why does it have two params here?
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.