我有一个看起来像这样的路由器:
App.Router = Em.Router.extend({
enableLogging: true,
root: Em.Route.extend({
index: Em.Route.extend({
route:'/',
connectOutlets: function(router, context){
router.get('applicationController').connectOutlet('textChallenge', App.TextChallenge.find());
}
}),
textChallenge: Em.Route.extend({
route:'/textChallenge/:challengeId',
connectOutlets: function(router, context){
router.get('applicationController').connectOutlet('textChallenge', context);
},
//this doesn't really work yet
serialize: function(router, context){
return{
challengeId: context.get('challengeId')
}
},
deserialize: function(router, urlParams){
return App.TextChallenge.find(urlParams.challengeId);
}
})
})
});
但是,我试图在 UIWebView 中运行它,它不喜欢被弄乱的 URL(请参阅此问题:https ://github.com/emberjs/ember.js/issues/1575 )。我只是不太明白如何在这里实现 Ember.NoneLocation。有什么想法吗?