ember-old-router

emberjs router class active

时光怂恿深爱的人放手 提交于 2020-01-16 04:51:44
问题 I know i can find examples of this but i cant put it into my code without errors... just dont know why. I want start with set class="menu-active" to first in menu. <li><a {{action gotoAbout}} >About</a></li> And later when somebody click other position of menu move class="menu-active" to this position. http://jsfiddle.net/kwladyka/LGArM/3/ And the bonus question: Do you have any remarks to make my code better? HTML <script type="text/x-handlebars" data-template-name="application"> {{view App

Ember-Data: How do “mappings” work

本小妞迷上赌 提交于 2020-01-09 09:10:15
问题 I'm currently trying to put something together with ember + emberdata + router + asp.net web api. Most of it seem to work, however I stuck in an error message I get when ember-data tries to findAll through the adapter for my models. In my backend I have a model like this (C#): public class Genre { [Key] public int Id { get; set; } [Required] [StringLength(50, MinimumLength=3)] public string Name { get; set; } } Which in my app I represent it like this using ember-data: App.Genre = DS.Model

Ember-Data: How do “mappings” work

妖精的绣舞 提交于 2020-01-09 09:10:12
问题 I'm currently trying to put something together with ember + emberdata + router + asp.net web api. Most of it seem to work, however I stuck in an error message I get when ember-data tries to findAll through the adapter for my models. In my backend I have a model like this (C#): public class Genre { [Key] public int Id { get; set; } [Required] [StringLength(50, MinimumLength=3)] public string Name { get; set; } } Which in my app I represent it like this using ember-data: App.Genre = DS.Model

Ember.js - CRUD scenarios - Specifying View from within a Route

こ雲淡風輕ζ 提交于 2019-12-30 03:21:53
问题 I've asked a question previously in which I wanted to bind a collection residing in the controller to the list scenario view, however, I've added details and edit templates and views to my structure producing a couple of extra sub-routes: root.contacts.details -> /contacts/:contact_id root.contacts.edit -> /contacts/:contact_id/edit In my details scenarios I first started calling the connectOutlets as follows [...] connectOutlets: function (router, contact) { router.get('contactController')

How can i set the ApplicationController in Ember.Router

可紊 提交于 2019-12-21 14:36:31
问题 I there any other possibility to handle with Ember.Router controllers and views? My app structure generally depends on require.js which takes care of the corresponding dependencies. In my example i'm doing the App.ApplicationController thing as the main router controller. Here's a jsfiddle: http://jsfiddle.net/mediastuttgart/uMKGt/1/ But is there any chance to set this manually? I've found this commit message https://github.com/emberjs/ember.js/commit/be69395f5eec4187b1df052d7386bcda45f79475

Ember.js routing: how do you set a default route to render immediately?

∥☆過路亽.° 提交于 2019-12-21 00:14:45
问题 I'm sure this will become clear as I dig in deeper, but for now it's not obvious how to make this happen. I was following the info on this helpful SO article about routing but there is an important piece missing from the example, i.e. how do you get the 'home' view to render right away without having to click the 'home' link? I've started digging into the docs to try to make sense of this, but meanwhile it seems like a useful question to have answered for posterity. I've been playing with the

Ember Router - How to handle 404 (Not Found) routes?

拈花ヽ惹草 提交于 2019-12-20 09:38:08
问题 I'm trying to figure out how to handle invalid routes within my application using Ember.Router . Currently if I enter an invalid route, e.g. myapp.com/#FooBarDoesntExist, it will redirect to the index route ('/'). I'd like it if I could define a notFound or 404 state that it would route to so I can inform the user what happend. As opposed to them getting dumped on the home page. 回答1: Ember.Router in its current version does not provide means to handle unknown routes. Time to hack! Solution 1

Emberjs 1.x-pre- Ember.Router and Ember.computed issues

霸气de小男生 提交于 2019-12-20 03:12:09
问题 I was reading http://code418.com/blog/2012/03/26/advanced-emberjs-bindings/ and came across Ember.Binding.and for transform which has deprecated in the current emberjs for Ember.computed . I decided to update the old emberjs 0.9.x fiddle http://jsfiddle.net/Wjtcj/ to work with emberjs 1.x and provided an Ember.computed.and as shown in the new fiddle http://jsfiddle.net/Wjtcj/5/ . Though it works, i cant make it return thesame output as the old one but when an improved version of the code http

Ember.js Router Action to Controller

安稳与你 提交于 2019-12-18 12:37:41
问题 When I use the Ember Router, how can I define actions in the template who are connected to the controller? An Example is here: http://jsfiddle.net/KvJ38/3/ Unter My Profile are two actions: One is defined on the State, and is working Two is defined on the Controller. How can i make this working or should I use another approach? App.Router = Em.Router.extend({ enableLogging: true, location: 'hash', root: Em.State.extend({ // EVENTS goHome: Ember.State.transitionTo('home'), viewProfile: Ember

Right way to do navigation with Ember

陌路散爱 提交于 2019-12-17 08:22:06
问题 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? 回答1: <Update date="2013-01-16"> The previous examples are no longer valid