url-routing

How can I get AngularJS working with the ServiceStack FallbackRoute attribute to support HTML5 pushstate Urls?

对着背影说爱祢 提交于 2020-01-22 20:40:27
问题 I am building a client/server solution, using an AngularJS Single Page App as the client component and a Self-Host ServiceStack RESTful API as the server component. A single Visual Studio Console Application Project holds HTML and JavaScript files for the AngularJS component, along with C# classes for bootstrapping the ServiceStack AppHost (I have devolved Interface and Service responsibilities to separate Visual Studio Projects). I have set all HTML and JavaScript files to have a 'Build

Cancel route using Sammy.js without affecting history

浪子不回头ぞ 提交于 2020-01-22 18:15:33
问题 I want to intercept all route changes with Sammy to first check if there is a pending action. I have done this using the sammy.before API and I return false to cancel the route. This keeps the user on the 'page' but it still changes the hash in the browsers address bar and adds the route to the browsers' history. If I cancel the route, I dont want it in the address bar nor history, but instead I expect the address to stay the same. Currently, to get around this I can either call window

Emberjs will not load jquery/javascript, run code when html is inserted in the page

大城市里の小女人 提交于 2020-01-21 17:24:12
问题 Help! I'm working on a meaty emberjs/yeoman project that uses multiple hbs templates that can all be routed to from one application.hbs's sidebar. The problem is when I load the page, sometimes the Jquery to make that sidebar collapse will not work while other jquery in that same file does. Sometimes nothing works at all. I'm calling my javascript/jquery from one file called magic.js <body> <!-- build:js scripts/components.js --> <script src="bower_components/jquery/jquery.js"></script>

Emberjs will not load jquery/javascript, run code when html is inserted in the page

扶醉桌前 提交于 2020-01-21 17:23:30
问题 Help! I'm working on a meaty emberjs/yeoman project that uses multiple hbs templates that can all be routed to from one application.hbs's sidebar. The problem is when I load the page, sometimes the Jquery to make that sidebar collapse will not work while other jquery in that same file does. Sometimes nothing works at all. I'm calling my javascript/jquery from one file called magic.js <body> <!-- build:js scripts/components.js --> <script src="bower_components/jquery/jquery.js"></script>

Open page url in modal on a page (Facebook Photo URLs)

跟風遠走 提交于 2020-01-15 23:13:51
问题 P.S. I am using html5Mode to remove '#' in routing in below scenario Removing the fragment identifier from AngularJS urls (# symbol) Consider I have two main pages.One is photos where thumbnails are provided and whose url is /someSlug/photos . Other is the url of a single photo '/someSlug/photos/somePhotoId' which shows a bigger view of a particular photo. My problem is to show the /someSlug/photos/somePhotoId page in modal when user clicked on somePhoto thumbnail in photos page (and yes the

How to route cutom URL with to custom controller in CodeIgniter?

孤街醉人 提交于 2020-01-15 06:25:15
问题 I have a PHP CodeIgniter Controller with name User and have a method that get details of user user_detail($username) Now when i need to show user data for example for userName mike I call this URL http://www.example.com/user/user_detail/mike My target How to make user data accessible by next URLs http://www.example.com/user/mike or / and http://www.example.com/mike 回答1: You have to read the this page from the official documentation of codeigniter. It covers all related things to Routing URLs

How to update a collection in Web API?

江枫思渺然 提交于 2020-01-15 03:25:46
问题 I have a basic Order - OrderItem situation and I'm struggling how to update Items in one request (or if should I?) Let me explain and I'm gonna ask the question at the end. Models: public class Order { public int OrderId { get; set; } public string CustomerId { get; set; } public bool IsVoided { get; set; } public List<OrderItem> Items { get; set; } } public class OrderItem { public int OrderItemId { get; set; } public string Name { get; set; } public int Quantity { get; set; } public int

PWA with multiple pages

我是研究僧i 提交于 2020-01-13 10:07:12
问题 I'm creating a PWA for my website. It was a multiple page website built using jquery. Now I have created an app shell which consists of a common header for the site. My site has good SEO ranking and ranks in top 3 links usually. Now when I want to go from page A to page B and I want the header to be preloaded and a loader gets displayed until the data for page B is received from the server. I am still using jquery as most of the modules are already built in that and I don't want to rebuild

asp.net mvc routing: how to use default action but non-default parameter?

孤人 提交于 2020-01-12 12:49:26
问题 I'm rewriting the question, as the answers so far show me that I have not defined it good enough. I'll leave the original question for reference below. When you set up your routing you can specify defaults for different url/route parts. Let's consider example that VS wizard generates: routes.MapRoute( "Default", // Route name "{controller}/{action}/{id}", // URL with parameters new { controller = "DefaultPage", action = "Index", id = UrlParameter.Optional } // Parameter defaults In this

How to accept sorting and pagination parameters in all REST URIs using Slim?

懵懂的女人 提交于 2020-01-12 10:21:34
问题 I am using the Slim PHP framework to create a RESTful API for my app. I would like all URLs to be able to accept parameters for sorting and pagination. Can someone tell me the best way to do this? Also, can someone provide me with some proper REST URIs to this? (i.e. http://domain.com/api/category/fruit/?sort=DESC&results=25&page=2) <?php require 'Slim/Slim.php'; $sort = "ASC"; $results = 10; $page = 1; $app = new Slim(); $app->get('/wines', function () use ($app) { $sort = $app->request()-