single-page-application

Breeze with a Unit Of Work/Repository pattern

我只是一个虾纸丫 提交于 2019-12-03 13:00:28
I was just wondering how I should go about implementing breeze's EFContextProvider in a separate data layer project. Also, since that project is a class library and not an MVC 4 application, how should I include this into my project? I don't really need the whole bag of tricks that is in the Breeze NuGet package, just EFContextProvider stuff. I want to implement a Unit of work pattern using the EFContextProvider DbContext wrapper, like John Papa has done in his wonderful pluralsight course. Has anyone done this yet? any tips? Thanks We've got a more sophisticated sample coming called "TempHire

How to show/hide ReactJS components

两盒软妹~` 提交于 2019-12-03 12:27:32
问题 Trying to learn ReactJS.. but what confuses me is the rendering of the component. Every example I've seen defines a React component class and at the end has something like: React.renderComponent( <comp attr="value"" />, document.getElementById('comp') ); I understand that it replaces the 'comp' element with my component.. that's great. But it seems if I load 20 components, all 20 render. However, I only want to render some and not all, but use all throughout my SPA. I am using DirectorJS

Single Page App + Amazon S3 + Amazon CloudFront + Prerender.io - how to set up?

橙三吉。 提交于 2019-12-03 11:48:49
I have single page app built with Backbone.js. I host app (app consists of static files only) on Amazon S3. I use CloudFront as a Bucket CDN. App is accessed by https://myapp.com -> https://abcdefgh34545.cloudfront.com -> https://myBucket.s3-eu-west-1.amazonaws.com/index.html How I can use Prerender.io service with this stack? I have to somehow detect that WebSpider/WebRobot is accessing the page and redirect it to prerender.io... It's hard to use Prerender.io with a static Amazon S3 site. You could stand up an nginx/apache server in front of s3: https://myapp.com -> https://mynginx-server.com

Remove authentication in ASP.net MVC single page application

妖精的绣舞 提交于 2019-12-03 11:40:58
问题 I am trying to play about with the asp.net MVC SPA template in visual studio 2013, I don't need any of the authentication bits, I just need to load directly onto one of the controllers pages. How do I get rid of all the authentication stuff from the initial template? 回答1: Remove the [Authorize] annotation from HomeController and remove this: @section Scripts{ @Scripts.Render("~/bundles/knockout") @Scripts.Render("~/bundles/app") } from Views\Home\Index.cshtml because one of does js is causing

Websocket: maintain user session after page reloading

ぐ巨炮叔叔 提交于 2019-12-03 09:07:16
I've got a simple Single Page Application using jetty websockets for communication between server and client. Problem: Each time I have reload page my websocket connection is disabled and new is initialized. The problem is that user should relogin on each page refresh. Question: How can I eliminate the need of relogin on page refresh? EDITED: Faced the next problem : how to decide when session should be deleted? I've a peer object on the server side which is a nothing else but websocket session container. Peer is deleted on onClose method, which in turn is invoked on droping client side

Node js as http server and host angularJS SPA

*爱你&永不变心* 提交于 2019-12-03 08:56:19
问题 I have an application written on angularJS and built by grunt. Is there a way I can create a http server from node js and host it there. Please share any code snippet or document which would help. Thanks 回答1: (simplest) if you don't have any server side logic, you can simply serve client side AngularJS/HTML/css via http-server module from npm. https://www.npmjs.com/package/http-server Just install it via $>npm install -g http-server and go to your client folder, type http-server and hit enter

Durandal: How to route away from current view within that view's activate() function?

大兔子大兔子 提交于 2019-12-03 08:55:55
I have the following: function activate(routeData) { // make dataservice call, evaluate results here. If condition is met, reroute: if (true){ router.navigateTo("#/someRoute"); } alert ("should not be shown"); } The alert is getting hit however, and then the view changes. How do I fully navigate away from the current item and prevent any further code in that vm from being hit? Update: I tried using guardroute but I have to activate the viewModel to call the dataservice that returns the data that determines whether or not I should re-route. Using guardroute totally prevents the dataservice from

OWIN send static file for multiple routes

天大地大妈咪最大 提交于 2019-12-03 08:20:06
问题 I'm making a SPA which sits on top of ASP.Net WebAPI. I'm waiting to use HTML5 history rather than #/ for history routing but that poses a problem for deep linking, I need to make sure / and /foo/bar all return the same HTML file (and my JS will render the right part of the SPA). How do I get OWIN/Katana to return the same HTML file for multiple different urls? 回答1: To make things simple, while still keeping all the caching goodness etc. from the StaticFiles middleware, I'd just rewrite the

AngularJS or SPA with JWT - expiry and refresh

假如想象 提交于 2019-12-03 08:19:59
问题 I understand the flow of JWT and a single page application in terms of login and JWT issuance. However, if the JWT has a baked in expiry, AND the server isn't issuing a new JWT on each request, what is the best way for renewing? There is a concept of refresh tokens, but storing such a thing in a web browser sounds like a golden ticket. IE I could easily go into a browsers local storage and steal a refresh token. Then I could go to another computer and issue myself a new token. I feel like

Google analytics (via tag manager) loses track of adwords visitors after first pageload

与世无争的帅哥 提交于 2019-12-03 08:09:03
I am experiencing a very strange problem with Google tag manager (GTM), Google analytics (GA) and Google adwords. So far I am getting nowhere with solving it. The setup: We have a singe page application (backbone and marionette) and we are using GTM to push virtual pageviews to GA using standard dataLayer.push events (and also e-commerce events if this is relevant). This setup generally works fine. The problem: The problem is users coming from adwords, with a gclid tag. The first pageview for these users is tracked and attributed do the adword campaign correctly, but as soon as they click any