single-page-application

GTM randomly skips initial pageview in single page app

廉价感情. 提交于 2019-12-03 23:31:56
问题 I have Pageview tag in Google Tag Manager that tracks SPA pageviews, identical to the one described in this guide. Basically it is Universal Analytics with linked Google Analytics ID that is triggered on History Change (at some point All Pages trigger was also added with no success). In my current app GTM skips Pageview tag on initial pageviews on all routes that don't have async resolvers. Usually the routes fire the tag sometimes (1 of 5 times), this may vary a bit depending on conditions

How can I serve robots.txt on an SPA using React with Firebase hosting?

不打扰是莪最后的温柔 提交于 2019-12-03 17:47:52
问题 I have an SPA built using create-react-app and wish to have a robots.txt like this: http://example.com/robots.txt I see on this page that: You need to make sure your server is configured to catch any URL after it's configured to serve from a directory. But for firebase hosting, I'm not sure what to do. 回答1: In my /public directory, I created a robots.txt . In my /src directory, I did the following: I created /src/index.js : import React from 'react' import ReactDOM from 'react-dom' import

“Please add a @NgModule annotation” Error on Angular2

拟墨画扇 提交于 2019-12-03 17:47:24
问题 I have made a custom angular2(5.0.x) module that looks like this : import { GuageService } from './services/guage.service'; import { NgModule } from '@angular/core'; import { CommonModule } from '@angular/common'; import { GuageComponent } from './guage/guage.component'; @NgModule({ declarations: [GuageComponent], imports: [ CommonModule ], providers : [GuageService], exports : [GuageComponent] }) export class GuageModule {} I use it in my app modules like this: import { BrowserModule } from

How to pass data (selected item) to Durandal composed detail view?

為{幸葍}努か 提交于 2019-12-03 17:45:45
问题 I've started using (as of, a few hours ago) Durandal with the hope to manage views and allow composition within a single page - the previous approach, also using Knockout, was getting too unwieldy to maintain in a fat HTML file. I've installed/setup Durandal and I can create views and viewmodels - however, I don't know how to get data into the viewmodel to use as a basis for the new viewmodel. For instance, I have a "left nav bar" for selecting items - when an item is selected it updates a

Do HTML5 development using grunt and bower with WebSite project or create HTML5 Web app in Visual Studio 2015?

北慕城南 提交于 2019-12-03 16:32:28
I want to build a custom PURE HTML5 Web Template, for HTML5/CSS3/JavaScript single page application development, and then use that as a starting place for SPA HTML5 web development. Microsoft clearly recommends using Web Applications, but provides NO pure HTML5 web application template, thus this task is left to end users. I am not asking if I should use an ASP.NET Web Site or ASP.NET Web Application instead I am asking, what template configuration can I arrange that will let me use the most modern HTML5 tools and workflows, and is it the Web Application (with .csproj or .xproj project file)

How to implement offline capable Single Page Application with Breeze.js and HTML5 local storage

无人久伴 提交于 2019-12-03 16:00:50
I have working Single Page Application using Breeze.js for Data Access. It uses the Breeze.js to execute queries against the local cache and the data is requested only once at start up. Only the data updates are posted back on the server afterwards. I am looking for a solution to make the application connection aware. If the mobile device does not have internet connection the changes will be saved locally with Breeze.js and HTML5 local storage. When the mobile device is back online the changes will be synched to the remote data storage. Any guidelines how to implement that requirement? Thanks

FB Like button shows up only once - on first load of my AngularJS view

假如想象 提交于 2019-12-03 15:09:55
I am trying to place the FB like button on my single page site built on Angular JS. The like button has to be displayed on a view (different than the index.html) displayed by a controller. But the like button shows up only for the first time I load that particular view. The button do not show up if I come back after visiting another view. Below is the code which loads FB SDK in the controller for the view - (function (d, s, id) { var js, fjs = d.getElementsByTagName(s)[0]; if (d.getElementById(id)) { return; } js = d.createElement(s); js.id = id; js.src = "//connect.facebook.net/en_US/all.js

Bootstrap 4 on Single Page Application Angular + .Net Core

冷暖自知 提交于 2019-12-03 14:08:41
问题 Anyone tried to make an application with dotnet new --install Microsoft.AspNetCore.SpaTemplates::* dotnet new angular ? like in this example https://blogs.msdn.microsoft.com/webdev/2017/02/14/building-single-page-applications-on-asp-net-core-with-javascriptservices/ This command makes an angular + .net core project with bootstrap 3. I'm trying to put bootstrap 4 instead. I tried to put bootstrap 4 css over vendor.css (where bootstrap 3 is located) but without succes. Does anyone know how to

JWT tokens in sessionStorage vs cookies?

孤者浪人 提交于 2019-12-03 13:36:46
问题 There are a lot of blog posts from Stormpath that talk about how you ought to use cookies to store your JWT instead of sessionStorage/localStorage: https://stormpath.com/blog/where-to-store-your-jwts-cookies-vs-html5-web-storage https://stormpath.com/blog/token-auth-spa https://stormpath.com/blog/build-secure-user-interfaces-using-jwts The main stated reason is that if a 3rd-party javascript dependency that you load is compromised that it can pilfer through sessionStorage/localStorage and

Precompiled Single-Page-Apps in Phoenix App

我是研究僧i 提交于 2019-12-03 13:29:24
问题 I have a pre-compiled ember.js app (which fronted-js-framework shouldn't matter here), which basically consists of a folder with a index.html file, and a few js/css assets. I placed this folder under /priv/static in my phoenix app, and tried to get the routing to serve it... without success so far. I'm on phoenix version 0.17.1 (same as 1.0 afaik). I tried the following steps, in that order: In endpoint.ex, I removed the only: ~w(...) filter. Implemented a bare minimum controller with a