我的路由器看起来像这样:
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。有什么想法吗?
答案 0 :(得分:3)
我相信它就像在路由器location: 'none'