routing

How to pass $state variable into 2 other sibling $states?

大兔子大兔子 提交于 2019-12-01 06:45:19
Plnkr: https://plnkr.co/edit/Brmcxd2LjGVJ6DXwuJtF?p=preview Architecture: $login -> $container (contains $dashboard and $feed ), dashboard contains: $tickers , $tags , $viewHeader and $socialMedia components. Goal: tags needs to communicate and send a tag object into the viewHeader and socialMedia states. Expected: After Login , selecting a button in the Tags list should send that tag into the ViewHeader and SocialMedia states/components. Results: After Login , selecting a button in the Tags and going to $state dashboard the $states for the ViewHeader and SocialMedia refresh but the view model

Routing with express.js - Cannot GET Error

柔情痞子 提交于 2019-12-01 06:42:19
Working with express.js for the first time, and I am stuck on adding my first route. My route is defined in app.js like so: app.get('/user/:id/photos', function(req,res){ res.send('user' + req.params.id); }); However curling to http://localhost:3000/user/1/photos just results in a "cannot GET" error. The index file that was included with express seems to work just fine though. This is my express app.js file: var express = require('express'), routes = require('./routes'); var app = module.exports = express.createServer(); // Configuration app.configure(function() { app.set('views', __dirname +

ActionLink Includes Current {id} in URL

两盒软妹~` 提交于 2019-12-01 06:36:10
问题 The page currently displayed in my browser is: http://localhost:19255/Object/Browse/1 . A link on this page is created with: @Html.ActionLink("...", "Browse", "Object") But the generated link is actually: /Object/Browse/1 My understanding of what's happening is that MVC sees my route has an {id} portion, which I did not supply. So it went ahead and included the {id} portion from the current page. Fair enough, but how do I create a link without it? I tried null , and new { id = null } but

How to define default date values in Symfony2 routes?

帅比萌擦擦* 提交于 2019-12-01 06:29:59
If I want to create a route, where the year, month and date are variables, how can I define that if these variables are empty, the current date shall be taken? E.g. like this (doesn't work for sure...) blog: path: /blog/{year}/{month}/{day} defaults: { _controller: AcmeBlogBundle:Blog:index, year: current_year, month: current_month day: current_day } I thought about defining two different routes, like this blog_current_day: path: /blog defaults: { _controller: AcmeBlogBundle:Blog:index } blog: path: /blog/{year}/{month}/{day} defaults: { _controller: AcmeBlogBundle:Blog:index } But if I then

Rails reload dynamic routes on multiple instances/servers

徘徊边缘 提交于 2019-12-01 06:26:37
How can we force Rails to reload_routes on multiple servers/instances? We have a multi-tenant platform in Google App-Engine running on 5+ instances and we want all of our sites to define their own set of routes from the backend. Whenever we have a new site we currently have to restart all servers in order to be able to access the new routes. We followed this guide but it does only work on a local environment and is not updating routes on all servers in production without restarting the servers. Our route files look like this: routes.rb Frontend::Application.routes.draw do root 'home#index' ...

vue-router creates always a new Component instance

允我心安 提交于 2019-12-01 06:22:14
问题 I found an issue in vue-router which triggers me a lot. Always when I switch between my routes, a new instance of the component is created. Further the old instances are not deleted and are running in background! I would expect that when I open a route, the old components will be destroyed or stop running. Is there a workaround to fix that issue? Here is a fiddle: https://jsfiddle.net/4xfa2f19/5885/ let foo = { template: '<div>Foo</div>', mounted() { console.log('Mount Foo with uid: ' + this.

AngularJS routing in MVC application with templates

痴心易碎 提交于 2019-12-01 06:04:52
问题 I have 3 MVC controllers : Dashboard (the one by default) Customer Employee For each, only the "Index" action is available with only the "Index" view. In the layout, I have a simple menu with 3 entries : "Dashboard","Customer" and "Employee" ( @Html.ActionLink("Dashboard", "Index", "Dashboard") ) No problem, I can change view via the menu. No I added 3 angularjs controllers ("/App/Controllers/CustomerController",...) these controllers has been added to a bundle. In the layout page, there is a

Flexible dynamic routing with Silex

拜拜、爱过 提交于 2019-12-01 05:52:09
问题 Is it possible to have an unknown number of arguments for a get request? Example, this works but isn't ideal. $app->get('/print/{template}/{arg1}/{arg2}', function ($template, $arg1, $arg2) use ($app) { $str = $template . " " . $arg1 . " " . $arg2; return $str; }) ->value('template', FALSE) ->value('arg1', FALSE) ->value('arg2', FALSE); What I'd like is an array of arguments returned for anything entered after the template variable. I can't see more than 4 or 5 arguments being required, but i

Reroute old content (.html/.php etc.) to Ruby on Rails

别说谁变了你拦得住时间么 提交于 2019-12-01 05:39:53
问题 I have switched to Ruby on Rails and my current problem is to reroute the old contents like XXX/dummy.html or XXX/dummy.php in RoR. What exactly is the best solution for isolated content ( XXX/onlyinstance.html ) content which has a internal structure like XXX/dummy1.html , XXX/dummy2.html http://guides.rubyonrails.org/routing.html does not explain how to migrate old content. Note: Changing the old links is NOT an option. The website is hosted, it is not my own server. As the domain hasn't

ASP.NET MVC Html.ActionLink result URL - the way of encoding

痞子三分冷 提交于 2019-12-01 05:38:51
I create an amount of actions in MVC controllers. public ActionResult DoSmth1(string token) public ActionResult DoAnother2(string token) And when I have to call ActionLink.. =Html.ActionLink<SomeController>( x=> x.DoSmth(item.property), item.property) =Html.ActionLink<AnotherController>( x=> x.DoAnother(item.property), item.property) ...it generates me different URLs: /Some/DoSmth/stringvalue /Another/DoAnother?property=stringvalue Where to set the way it builds an URL? I am alr have no ideas...(( OK, a got some waylight: - if the property names are the same that used in routing schema - eg