single-page-application

Call function on directive parent scope with directive scope argument

99封情书 提交于 2019-11-29 22:57:34
I am developing a directive which shows and hides it's contents based on a click event (ng-click) defined in it's template. On some views where the directive is used I'd like to be able to know if the directive is currently showing or hiding it's contents so I can respond to the DOM changes. The directive has isolated scope and I am trying to notify the parent scope when the directive has been "toggled". I'm attempting to accomplish this by passing a callback function to the directive where it is used that can be called when the directive's state changes i.e hides or shows I'm not sure how to

ValidateAntiForgeryToken with SPA architecture

烈酒焚心 提交于 2019-11-29 22:40:41
I am trying to set Register and Login for Hot Towel SPA applicantion. I have created SimpleMembershipFilters and ValidateHttpAntiForgeryTokenAttribute based on the asp.net single page application template . How do you get the @Html.AntiForgeryToken() code to work in the Durandal SPA pattern. Currently I have a register.html <section> <h2 data-bind="text: title"></h2> <label>Firstname:</label><input data-bind="value: firstName" type="text" /> <label>Lastname:</label><input data-bind="value: lastName" type="text" /> <label>Email:</label><input data-bind="value: emailAddress" type="text" />

Html5 pushstate Urls on ServiceStack

放肆的年华 提交于 2019-11-29 22:07:36
问题 At the moment we're using a default.cshtml view in the root of ServiceStack to serve our AngularJS single-page app. What I'd like to do is enable support for html5 pushstate (so no hash in the URL), but the only examples I've found so far involve a dependency on MVC with a wildcard route, and pushing the ServiceStack infrastructure to a /api subroute. We can't take the MVC dependency, so I think we need for accept:text/html requests we need to accept any url and serve up our root application.

Using vue.js with semantic UI

不打扰是莪最后的温柔 提交于 2019-11-29 20:22:17
I'm trying to use webpack + Semantic UI with Vue.js and I found this library https://vueui.github.io/ But there was problem compling: ERROR in ./~/vue-ui/components/sidebar/sidebar.jade Module parse failed: /Project/node_modules/vue- ui/components/sidebar/sidebar.jade Unexpected token (1:24) You may need an appropriate loader to handle this file type. So I installed jade(pug) but still no luck. And there's comment in github for that lib: WIP, do not use ( https://github.com/vueui/vue-ui ) I've managed to import semantic css in my templates like this: @import './assets/libs/semantic/dist

Why do we need a Single Page Application? [closed]

余生颓废 提交于 2019-11-29 19:05:53
The Single Page Application (SPA) has come to us. A lot of new things come with it as well, like Routing, Page life cycle at client side, MVC pattern, MVVM pattern, MV* pattern,... and some of Javascript patterns also come to us like AMD pattern , Singleton , Facade ,.. A lot of SPA frameworks and libraries also were developed. We can find out some of its on the internet. They are AngularJs , Reactjs , BackboneJs , DurandalJs ,.. and a lot of third party components to make the Javascript coding more easy like RequireJs , Amplifyjs , BreezeJs ... But I just think why do we need the SPA? Because

Apply loading spinner during ui-router resolve

梦想的初衷 提交于 2019-11-29 18:49:35
resolve property of $routeProvider allows to execute some jobs BEFORE corresponding view is rendered. What if I want to display a spinner while those jobs are executed in order to increase user experience? Indeed, otherwise the user would feel the application has been blocked since no view elements were displayed for some milliseconds > 600 for instance. Of course, there was the way to define a global div element out of the current view to display in order to display the spinner thanks to the $scope.$rootChangeStart function. But I don't want to hide the whole page with just a poor spinner in

Does using AJAX on your website drop your page views while ranking?

女生的网名这么多〃 提交于 2019-11-29 17:33:46
Since its related to AJAX technology so I thought this is the best place to ask. I am displaying 5 articles at a time to the user on my website and when he clicks 'Next' I load the next 5 articles using AJAX without loading the entire page.The result is that he always stays at the same page . One of my friend told me that website ranking depends on number of page views and I think this obviously reduce my page views. Should I not use AJAX then? (This might be a stupid question but I seriously have no idea about ranking and SEO so please help) By loading your content dynamically Google will not

Redirect unknown requests to index.html in springboot

北战南征 提交于 2019-11-29 17:08:54
I'm trying to get an Angular2 app served up through a springboot web application. I've found lots of examples of how to do this very simply: https://spring.io/blog/2015/01/12/spring-and-angular-js-a-secure-single-page-application#using-spring-boot-cli https://github.com/zouabimourad/angular2-spring/tree/master/front https://github.com/ehirsch/spring-angular2 However, these examples are very simple, and they just basically show how to display static content that happens to be Angular. None of them show how to handle any of the URLs (I think they're called routes) the Angular2 app uses that don

Is there a configuration in Github Pages that allows you to redirect everything to index.html for a Single Page App?

喜欢而已 提交于 2019-11-29 15:30:43
I'm trying to post my SPA app that works fine locally but when I push it to Github Pages, the interior pages don't register if you navigate to them directly. For example http://USER.github.io/PROJECT_NAME/ works but http://USER.github.io/PROJECT_NAME/about doesn't because theres no redirect or rewrite. The index.html is located at the root of the project. I just built this tiny package (for bower / npm) to solves that exact problem so I thought I'd share it here as an answer to your question, https://github.com/websemantics/gh-pages-spa If you include the package in your 404.html and index

Multiple Aurelia apps on one page

倾然丶 夕夏残阳落幕 提交于 2019-11-29 15:27:56
As there isn't much information about Aurelia framework I got stuck with these 2 questions. Is it possible to create multiple Aurelia apps on single page and how this can be achieved? Alternatively is there a way to call out single application templates in 2 different places outside the main app container? For example I want to use Aurelia SPA in CMS system and call it out in different elements like header, main container and aside container. Yep, just add two elements to the page with an aurelia-app attribute. Here's an example: https://gist.run?id=2d310abbbea337fb5f6d110ec807f7d2 <!doctype