ember-router

Is resource nesting the only way to enable multiple dynamic segments?

ⅰ亾dé卋堺 提交于 2019-11-27 13:18:23
This seems to suggest that the answer is yes: From Ember Pre1 to Pre4: Multiple dynamic segments per route? Update: What is the allowed syntax for dynamic segments? ... but I just want to confirm. In my case, as a learning exercise, I'm building a calendar in Ember, with monthly displays. I need to be able to link from a given month to the previous month, and to the next month. So I'd like to be able to {{ linkTo calendar_month year month }} and this.transitionTo('calendarMonth', year, month) Wondering if this is feasible without using nested resources. I can get it working with something like

Ember.js sorting and filtering children of a hasMany relationship in parent route

时光总嘲笑我的痴心妄想 提交于 2019-11-27 12:13:54
问题 Update #2 I found that when I refactored the filtering logic to take place in a compound computed property within the PostController instead of within individual routes, I was able to get it working. The solution was ultimately dependent upon a single dynamic variable set by the specific #linkTo route action that triggered filtering changes within a PostController computed property. I have a lot of work to catch up on so I can't post the solution to this specific question now, but when I can

Right way to do navigation with Ember

折月煮酒 提交于 2019-11-27 06:34:19
What's the "right way" (or at least the options, if there is no single "Ember way" of doing this) for a navigation sidebar? Should I be looking at ContainerViews somehow, or should I just use the new outlet feature and stick the navigation inside my application view? In addition, what's the "right way" to set an .active class on an li depending on the URL (I'm using routing)? Is there some kind of a helper for this? MilkyWayJoe <Update date="2013-01-16"> The previous examples are no longer valid since the recent changes in the Router API, so I'm not going to fix those. All applications using

Nested routes rendering into same template/outlet breaks on browser back button click

自古美人都是妖i 提交于 2019-11-27 05:26:11
问题 I have a nested route hierarchy that I need for my application to track user model selections. I'm trying to use a main application template and have each route render into a single outlet on that template. This works as I traverse down the route hierarchy from parent to child. However once you click the browser back button to go back up the route hierarchy the parent route renderTemplate hook doesn't fire. This results in the child being unhooked from the outlet and nothing rendered back

What is the complete list of expected JSON responses for DS.RESTAdapter?

蓝咒 提交于 2019-11-27 04:57:46
问题 I am attempting to write a custom express.js based server for an Ember.js app. I am getting along fairly well but I'm constantly getting stuck trying to guess what JSON responses Ember Data is expecting at a given moment. This brand new documentation is a great start http://emberjs.com/guides/models/the-rest-adapter/ but not complete enough. My stabbing in the dark has lead me to understand (Ember pre4, Ember Data 11): Context Server URL Method Req. Data Resp. Data ~~~~~~~ ~~~~~~~~~~ ~~~~~~ ~

Hashbang URLs using Ember.js

痞子三分冷 提交于 2019-11-27 04:00:39
I am trying to set up my Router to use "hashbang" URLs ( #! ). I tried this, but obviously it doesn't work: App.Router.map(function() { this.route("index", { path: "!/" }); this.route("otherState", { path: "!/otherState" }); }); Is this possible to do in Ember? twiz Teddy Zeenny's answer is mostly correct, and registerImplementation seems to be a clean way to implement this. I tried to just edit his answer to make it fully answer the question, but my edit got rejected. Anyway here is the full code to make Ember use hashbang URLs: (function() { var get = Ember.get, set = Ember.set; Ember

Ember router: how to use transitionTo

爱⌒轻易说出口 提交于 2019-11-27 03:39:28
问题 I have a link that looks like this index.html#/calendar/year/month This is how I set up my routes: App.Router.map(function() { this.resource('calendar', {path: 'calendar/:currentYear/:currentMonth'}); }); App.CalendarRoute = Ember.Route.extend({ model: function (params) { var obj = { weeks: calendar.getDaysInMonth(params.currentMonth, params.currentYear), currentMonth: params.currentMonth, currentYear: params.currentYear }; return obj; }, setUpController: function(controller, model) {

Hashbang URLs using Ember.js

时光毁灭记忆、已成空白 提交于 2019-11-26 17:33:11
问题 I am trying to set up my Router to use "hashbang" URLs ( #! ). I tried this, but obviously it doesn't work: App.Router.map(function() { this.route("index", { path: "!/" }); this.route("otherState", { path: "!/otherState" }); }); Is this possible to do in Ember? 回答1: Teddy Zeenny's answer is mostly correct, and registerImplementation seems to be a clean way to implement this. I tried to just edit his answer to make it fully answer the question, but my edit got rejected. Anyway here is the full