router

React redux connect with with styles and withrouter

荒凉一梦 提交于 2019-12-05 12:15:31
I am trying to use connect in redux react as Connect (mapstate.., mapdis..) (withstyles(dashboardstyle)(dashboard) The above works fine but I need to add withRouter as well. Below change gives error Connect (mapstate.., mapdis..) (withstyles(dashboardstyle), withrouter(dashboard)) Whenever I add it gives exception such as cannot use class as a function. Any ideas how this can be fixed You will need to install recompose: npm i -s recompose Then in your component: import compose from 'recompose/compose' export default compose( withStyles(styles), connect(mapStateToProps, mapDispatchToProps) )

Ember.js - Call parent model hook to load data for child

喜欢而已 提交于 2019-12-05 09:55:25
I have a master/detail view in Ember. If i am calling the detail page directly, the model hook of the detail page needs the model(data) from the parent(master). The detail model hook is called - whats the proper way to get/call the model so the modelFor function in the detail hook works. Router: App.Router.map(function(){ this.resource('index', { path: '/' } ); this.resource('devices', { path: '/devices'}, function() { this.resource('device', { path: ':imei'}); }); }); Master Route: App.DevicesIndexRoute = Ember.Route.extend({ model: function() { var self = this; return requestController.get({

Emberjs - How to access the current state or route name in RC1?

这一生的挚爱 提交于 2019-12-05 06:34:38
In RC1 how can I get the currentstatename or current route name globally? More specific, alternate syntax of : App.get('router').currentState.name; mavilein Have a look at the answer to this question: Ember App.Router.router.currentState undefined Short answer: The current state is stores in the ApplicationController under the name "currentPath". 来源: https://stackoverflow.com/questions/15318981/emberjs-how-to-access-the-current-state-or-route-name-in-rc1

Routing to sub routing module without lazy loading

与世无争的帅哥 提交于 2019-12-05 04:34:27
I want to have multiple routing modules in order to keep my application clean and easy to read. I currently use lazy loading for the SubComponent but I don't want to do this. So I am looking for a way to change this. Anyways, here is the currently working code. I have the following two routing files. app-routing.module.ts : import { NgModule } from '@angular/core'; import { Routes, RouterModule } from '@angular/router'; const routes: Routes = [ { path: '', component: HomeComponent }, { path: 'sub', loadChildren: './sub/sub.module#SubModule' } ]; @NgModule({ imports: [RouterModule.forRoot

angular2 TypeError: Cannot set property 'name' of undefined

梦想与她 提交于 2019-12-05 03:17:30
I have an Angular2 project, created at Mac OS and it running. But when I git it at Windows, it can not run. In Chrome, i get this error: core.umd.js:3491 EXCEPTION: Uncaught (in promise): TypeError: Cannot set property 'name' of undefined TypeError: Cannot set property 'name' of undefined at new EmptyError (http://localhost:3000/node_modules/rxjs/util/EmptyError.js:21:30) at FirstSubscriber._complete (http://localhost:3000/node_modules/rxjs/operator/first.js:148:31) at FirstSubscriber.Subscriber.complete (http://localhost:3000/node_modules/rxjs/Subscriber.js:114:18) at MergeAllSubscriber.

@angular/router 3.0.0-alpha.3: How to migrate OnActivate

我怕爱的太早我们不能终老 提交于 2019-12-05 01:28:23
I just upgraded @angular/router to 3.0.0-alpha.3. However, I cannot find the interface OnActivate which was available in 2.0.0-rc.1. Any hint is appreciated. Matt B I'm personally not convinced that CanActivate and Deactivate guards are the best places to migrate OnActivation logic that isn't a guard of some sort. Maybe the new router events are a better option: How to use NavigationStart Since we have no documentation yet and is coming in the following weeks. You wanted a hint. Here is what I found for you. It looks like you have to pass an additional parameter and specify a class to handle

In order for Udp multicast to work, router must support it?

你说的曾经没有我的故事 提交于 2019-12-04 18:19:47
I am wondering for the udp multicast to work, router must support it? Multicast is based on dynamically generated trees that can (theoretically) span the entire internet. These multicast trees are based on two protocols: IGMP : Internet Group Management Protocol. Used by receivers and users like me and you. PIM : Protocol Independent Multicast. Used by routers to replicate and reroute the packets accordingly. The client needs to be IGMP -compatible, and the routers need to be PIM -compatible. To be precise, you will need a multicast router if you want the traffic to traverse different subnets.

Obtain MAC Address of Devices in range of router

隐身守侯 提交于 2019-12-04 14:39:37
问题 Is it possible for a router to obtain the MAC address of nearby devices that have not connected to it? I want to write an app that notifies me somehow (email or something) when a specific MAC address comes within range of a router that I have (the app is much more specific than that so I cannot use prebuilt tools but if they are open source they could help). The router will be connected to the internet and the device is an iPhone so it is constantly looking for WiFi access points so I feel

React Router - Stay at the same page after refresh

倾然丶 夕夏残阳落幕 提交于 2019-12-04 13:50:32
I'm learning React. I have page with 4 subpages and i use React Router to go through those pages. Everything works fine except for reloading page. When i go from page "home" to "about" or other it's ok, but when i refresh page then it render again page "about" for a second and then it change page to home (home is default/first page).I want it to stay at that page which is currently rendered, not go back to home after every refresh. There is my code in index.js file where i render whole app and use router: <Provider store={store}> <Router path="/" history={browserHistory}> <Route path="/home"

Can i give the view a show up animation in emberjs

泪湿孤枕 提交于 2019-12-04 12:06:28
问题 Here is a example using emberjs router http://jsbin.com/agameq/edit. Now I wanna have some showup animation, like fadeIn or fadeOut, when route changed. what should I do? 回答1: Every View in ember has a method named didInsertElement : Called when the element of the view has been inserted into the DOM. Override this function to do any set up that requires an element in the document body. All ember views also have a $ which is a reference to jQuery, so you can wrap some element in your view with