ghempton / ember-routemanager Goto Github PK
View Code? Open in Web Editor NEWDevelopment has been suspended.
Home Page: http://codebrief.com/2012/07/anatomy-of-an-ember-dot-js-app-part-i-redux-routing-and-outlets/
License: MIT License
Development has been suspended.
Home Page: http://codebrief.com/2012/07/anatomy-of-an-ember-dot-js-app-part-i-redux-routing-and-outlets/
License: MIT License
Besides a few js-typos the routing does not work as soon as a substate is involved.
Hello,
With the current Head version of the StateManager, once you enter a state with a dynamic route you get stuck in this state when you want to reenter it with different routing parameters.
Section: Ember.State.create
route: "sections/:id"
initialState: "Description"
# Substates
Description: Ember.ViewState.create
route: "description"
view: S.views.QuoteSectionView.extend({contentBinding: "S.controllers.quoteController.selectedSection"})
#....
If I change the location to "section/123" record 123 with show up, but then if I change the location to "section/234" it will still show record 123 and the StateManager will not change state whatsoever.
Thanks,
Julien.
maybe I'm not understanding how I should be doing this... but I'm trying to use history links like this:
http://localhost/#some/path/?sort=name
the "query param" part does come thru on stateManager.params... but if I change only the queryparam part
http://localhost/#some/path/?sort=date
it doesn't seem to call my enter() method again... not sure what I'm missing
If base is
http://localhost.local:5000/
and loc is
http://localhost.local:5000/home
then
loc = loc.slice(base.length + 1, loc.length);
produces ome instead of home.
the regex example/test you have works well...but when I tried to create a route like this:
route: /account\/(\d+)\/community\/(\d+)/
captures: ['aid', 'cid']
it doesn't work... because the _matchState splits the location on '/' first, then tries to match each part of it
hello, i have an issue described here
http://stackoverflow.com/questions/10316865/emberjs-route-manager-initial-load
i'd appreciated if someone can help me out.
thanks!
When I go to action show, like in example in repo. Everything work for now, but in console I get error:
Uncaught TypeError: Cannot read property 'id' of undefined ember.js:16603
Ember._RouteMatcher.Ember.Object.extend.generate ember.js:16603
Ember.Routable.Ember.Mixin.create.absoluteRoute ember.js:16661
Ember.Routable.Ember.Mixin.create.updateRoute ember.js:16645
Ember.Routable.Ember.Mixin.create.stashContext ember.js:16639
xform ember.js:10106
invokeAction ember.js:4665
iterateSet ember.js:4638
sendEvent ember.js:4769
Ember.Evented.Ember.Mixin.create.fire ember.js:10120
Ember.State.Ember.Object.extend.fire ember.js:15869
Ember.wrap.newFunc ember.js:2355
Ember.StateManager.Ember.State.extend.triggerSetupContext ember.js:16467
Ember.ArrayUtils.forEach ember.js:3660
Ember.StateManager.Ember.State.extend.triggerSetupContext ember.js:16461
Ember.StateManager.Ember.State.extend.transitionTo ember.js:16455
Ember.StateManager.Ember.State.extend.goToState ember.js:16374
Ember.RouteManager.Ember.StateManager.extend.trigger ember-routemanager.js:321
Ember.RouteManager.Ember.StateManager.extend.locationDidChange ember-routemanager.js:277
(anonymous function) ember.js:3862
invokeAction ember.js:4665
iterateSet ember.js:4638
sendEvent ember.js:4769
notifyObservers ember.js:3779
Ember.notifyObservers ember.js:3934
propertyDidChange ember.js:4513
Cp.set ember.js:3499
set ember.js:2491
routes._skipRoute ember-routemanager.js:535
invoke ember.js:4873
invokeOnceTimer ember.js:5283
invoke ember.js:4873
iter ember.js:4935
Ember.ArrayUtils.forEach ember.js:3660
RunLoop.flush ember.js:4989
RunLoop.end ember.js:4907
Ember.run.end ember.js:5088
autorun:5155
But if I defines some custome action like posts/list after entered there I get:
Uncaught TypeError: Object episodes/saw has no method 'setURL' ember.js:16646
Ember.Routable.Ember.Mixin.create.updateRoute ember.js:16646
Ember.Routable.Ember.Mixin.create.stashContext ember.js:16639
xform ember.js:10106
invokeAction ember.js:4665
iterateSet ember.js:4638
sendEvent ember.js:4769
Ember.Evented.Ember.Mixin.create.fire ember.js:10120
Ember.State.Ember.Object.extend.fire ember.js:15869
Ember.wrap.newFunc ember.js:2355
Ember.StateManager.Ember.State.extend.triggerSetupContext ember.js:16467
Ember.ArrayUtils.forEach ember.js:3660
Ember.StateManager.Ember.State.extend.triggerSetupContext ember.js:16461
Ember.StateManager.Ember.State.extend.transitionTo ember.js:16455
Ember.StateManager.Ember.State.extend.goToState ember.js:16374
Ember.RouteManager.Ember.StateManager.extend.trigger ember-routemanager.js:310
Ember.RouteManager.Ember.StateManager.extend.locationDidChange ember-routemanager.js:277
(anonymous function) ember.js:3862
invokeAction ember.js:4665
iterateSet ember.js:4638
sendEvent ember.js:4769
notifyObservers ember.js:3779
Ember.notifyObservers ember.js:3934
propertyDidChange ember.js:4513
Cp.set ember.js:3499
set ember.js:2491
routes._skipRoute ember-routemanager.js:535
invoke ember.js:4873
invokeOnceTimer ember.js:5283
invoke ember.js:4873
iter ember.js:4935
Ember.ArrayUtils.forEach ember.js:3660
RunLoop.flush ember.js:4989
RunLoop.end ember.js:4907
Ember.run.end ember.js:5088
autorun ember.js:5155
I use ember-rails https://github.com/emberjs/ember-rails. So my ember.js file look like: https://github.com/emberjs/ember-rails/blob/master/vendor/ember/development/ember.js.
And my routing file looks like:
App.routeManager = Ember.RouteManager.create
enableLogging: true
home: Ember.State.create
enter: ->
console.log 'home'
posts: Ember.State.create
route: 'posts'
index: Ember.State.create
enter: ->
console.log 'index'
list: Ember.State.create
route: 'list'
enter: ->
console.log 'list'
show: Ember.State.create
route: ':id'
enter: ->
console.log 'show'
App.routeManager.start()
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.