single-page-application

How do I configure Undertow handlers to support proper rewriting for SPA bookmarking?

生来就可爱ヽ(ⅴ<●) 提交于 2019-12-06 04:52:01
I am trying to configure JBoss EAP 7 (via Undertow) to properly rewrite any SPA URLS back to the SPA's index.html using Undertow handlers. Unfortunately, my API is located at /api , so I need to let any requests pass through which start with /api . Here is my current configuration (lifted from another SO answer): not equals(%R, '/my-app') and not equals(%R, '/my-app/') and not equals(%R, '/my-app/index.html') and not path-prefix('/my-app/api') and not regex('/my-app/.*\.js') and regex('/my-app/.+') -> rewrite('/my-app/index.html') Unfortunately, this doesn't seem to be rewriting anything. How

Durandal Widget with multiple views

允我心安 提交于 2019-12-05 23:04:38
I am working on a SPA using Durandal, and I have created a widget for displaying a particular page component. Following the Durandal Documentation , the widget is in app/widgets/my-widget and is composed of viewmodel.js and view.html . Now, I want to add a different view to the same widget - in effect, to have a "Basic" view and an "Advanced" view, with a flag in the ViewModel for which one will be used. I do not want to create two different widgets, because the ViewModel is exactly the same and I want to avoid unnecessary code duplication. I also do not want to put both versions of the view

Single page application with Java EE/Wildfly: server-side configuration

…衆ロ難τιáo~ 提交于 2019-12-05 20:44:25
I want to write an SPA with AngularJS on client side and Java EE on server side. If I understand it correctly, the idea for the frontend is to create a default page (let's call it index.html ) and implement routing to exchange parts of this default page. So with every request the default page is loaded and the routing logic replaces its parts depending on context path: <!-- index.html --> <html> <body> <!-- this block is replaced depending on context --> <div ng-view></div> </body> </html> <!-- page one --> <div> <h1>Page One</h1> <a href="/specific">Some specific stuff</a> </div> <!-- page

AppEngine app.yaml config for single page apps

﹥>﹥吖頭↗ 提交于 2019-12-05 18:40:30
I'm having trouble with my app.yaml file - I have a single-page app (Angular2 app) on AppEngine with a python runtime, but the deep links aren't appropriately routed. Here's my app.yaml file: runtime: python27 api_version: 1 threadsafe: true skip_files: - ^(.*/)?app\.yaml - ^(.*/)?app\.yml - ^(.*/)?#.*# - ^(.*/)?.*~ - ^(.*/)?.*\.py[co] - ^(.*/)?.*/RCS/.* - ^(.*/)?\..* - ^(.*/)?tests$ - ^(.*/)?test$ - ^test/(.*/)? - ^COPYING.LESSER - ^README\..* - \.gitignore - ^\.git/.* - \.*\.lint$ - ^fabfile\.py - ^testrunner\.py - ^grunt\.js - ^node_modules/(.*/)? - ^src/(.*/)? - ^e2e/(.*/)? handlers: - url

Google NoCaptcha ReCaptcha only shows up on refresh in Angular SPA

我与影子孤独终老i 提交于 2019-12-05 17:53:49
I noticed that my new ReCaptcha only showed up "sometimes" so I tried to track it down. I have a SPA using Angular and when loading on the "/contact" page, the ReCaptcha shows up. If I load into any other page and try to navigate to the "/contact" page the ReCaptcha is not there, but if I refresh on that page, it appears again. Navigating away and returning to this page will cause it to disappear again. My setup is similar to the following: index.html <html ng-app="App"> <head> <meta charset="UTF-8"> <base href="/"> <title>...</title> <!-- STYLES --> <link rel="stylesheet" type="text/css" href

Breeze entities with typescript

折月煮酒 提交于 2019-12-05 17:11:25
I'm using Breeze + Typescript + Knockout for a Spa, and I'm facing the following problem: when I create a new entity with EntityManager.createEntity, typescript doesn't let me use the observables that Breeze generates from metadata. Typescript "sees" only the "entityAspect" and the "entityType" properties. I'm using the type definitions of DefinitelyTyped. Any help is greatly appreciated! You can create an interface for your type which extends breeze.Entity : /// <reference path="breeze.d.ts" /> module model { export interface ResponsesItem extends breeze.Entity { ContentTypeID: string; Title:

DurandalJS Routing Behavior

浪子不回头ぞ 提交于 2019-12-05 13:55:38
What I Have Trying to understand what's going on and how to control it. I have a "public" view for users that have not yet been authenticated, and a "home" view for users that are authenticated. Here's my route config: app.start().then(function() { //Replace 'viewmodels' in the moduleId with 'views' to locate the view. //Look for partial views in a 'views' folder in the root. viewLocator.useConvention(); //configure routing router.useConvention(); router.mapRoute('home', 'viewmodels/home', 'Test App', true); router.mapRoute('public', 'viewmodels/public', 'Test App', true); router.mapRoute('set

Vue.js computed property not updating

倖福魔咒の 提交于 2019-12-05 13:43:22
问题 I'm using a Vue.js computed property but am running into an issue: The computed method IS being called at the correct times, but the value returned by the computed method is being ignored! My method computed: { filteredClasses() { let classes = this.project.classes const ret = classes && classes.map(klass => { const klassRet = Object.assign({}, klass) klassRet.methods = klass.methods.filter(meth => this.isFiltered(meth, klass)) return klassRet }) console.log(JSON.stringify(ret)) return ret }

NancyFX Catch All route

江枫思渺然 提交于 2019-12-05 11:53:52
问题 Does NancyFX supports ASP.NET MVC like 'Catch All' route? I need one, that basically match every URL. This is very handy for building up Single Page applications. Is that possible? 回答1: Yes, using Regex Get[@"/(.*)"] = parameters => { return View["viewname", parameters]; }; But you don't really need it for building a Single Page Application with NancyFX - you can just use Get and Post with all your routing logic and still have a single page app. 回答2: Tested in Nancy version 0.23.2 Get[@"/(.*)

Angular 2 creating models vs working with json objects on the fly?

*爱你&永不变心* 提交于 2019-12-05 10:01:59
when interacting with a rest api using Angular 2. Is it worth creating typescript classes for each object (eg. employee, company, project, user ...). the other option is getting json object and working with it on the fly ? i suggest using models because : your code will be more readable for yourself after a while coming back to change it, every one else also can easily understand what you've done making changes in project will be more easily for example obj[0] does not have any special meaning but obj['username'] is more obvious you will get intellinsense in you IDE you can put logic in model