FAQ Database Discussion Community


Show vertical and horizontal navbar once logged in

c#,angularjs,twitter-bootstrap,single-page-application
I was wondering if there was a way I could show a vertical and horizontal navbar once the user has been authenticated. I have this code working for the horizontal navbar: <div class="navbar navbar-inverse navbar-fixed-top" role="navigation" data-ng-controller="indexController"> <div class="container"> <div class="navbar-header"> <a class="navbar-brand"> <img src="/images/AltheaLogo.png" alt="AltheaDx" style="margin-top: -13px; background-color: #E0E0E0...

Error: Failed to execute 'send' on 'XMLHttpRequest': Failed to load 'file' : AngularJS SPA

javascript,jquery,angularjs,single-page-application
I'm very new to Angular SPA and for the first time I get a code by Googling and try to run. But I get some errors in Console. I couldn't figure out why, I found list of following Console errors: XMLHttpRequest cannot load file:///C:/Users/hp/Downloads/single-page-app-angularjs-master/home.html. Cross origin requests are only supported...

Polymer single page application with lightbox

polymer,lightbox,single-page-application
regarding to this question i have changed my polymer spa a little to load content dynamically. next thing is to add a lightbox gallery. i have found a very lightweigt version here as standalone it works very good but in my dynamic content page i am not able to get...

Visual Studio MVC and WebStorm working together and minimizing assets

angularjs,visual-studio-2013,single-page-application,minify,webstorm
I'm developing a SPA application in VS. I have separated html (angularjs) and webapi services. I develop html pages and css in WebStorm (which is perfect for the job) and VS for webapi (WebStorm and VS project folders are the same). Everything works fine but I want to minimize html...

Can't figure why my function is not a function?

javascript,jquery,single-page-application
I am trying to build a simple single page web app and I am stuck. I am trying to use the module pattern : var spa = (function () { var initModule = function( $container ) { $container.html( '<h1 style="display:inline-block; margin: 25px;">' + 'hello world!' + '</h1>' ); }; return...

Is there a way to load JS and CSS only when necessary?

javascript,html,css,angularjs,single-page-application
We are rewriting a very large legacy Webforms .NET application. Ideally, I would like to have it completely as SPA, based on AngularJS, Bootstrap, and WebAPI. Obviously, the overall look and feel should be consistent across the application. I have one big concern, however. There are many "rich" controls (calendar,...

Best practices for adding/editing data using AngularJS

angularjs,single-page-application
I am currently developing an SPA application using AngularJS which allows end-users to add & edit orders via a form. What I would like to know is what is considered the best practice for determining whether the application is in an Edit or Create state? For example, when I click...

breeze.config.MetadataHelper is not a constructor error with Durandal and Breeze

javascript,requirejs,breeze,single-page-application,durandal
I am working on a SPA using Durandal v2.1 and Breeze v1.5. This is the first time I am using these libraries. I am creating the metadata for Breeze by hand, thus I'm using the Metadata-Helper plugin as explained in the documentation for Breeze. For this I am relying on...

fullPage.js: Make all slides and sections visible in search engine results

jquery,seo,web-crawler,single-page-application,fullpage.js
I'm using fullpage.js jQuery plugin for a Single page application. I'm using mostly default settings and the plugin works like a charm. When I got to the SEO though I couldn't properly make Google crawl my website on a "per slide" basis. All my slides are loaded at the page...

what does $data and $root mean in the following context

knockout.js,single-page-application
I am following the tutorials at knockoutjs website. This is a code from that. view <ul class="folders" data-bind="foreach: folders"> <li data-bind="text: $data, css: { selected: $data == $root.chosenFolderId() }, click: $root.goToFolder"></li> </ul> viewmodel function WebmailViewModel() { // Data var self = this; self.folders = ['Inbox', 'Archive', 'Sent', 'Spam']; self.chosenFolderId =...

Why Single-Page Web Application [closed]

asp.net,html5,single-page-application
While Single-Page application approach is rising as a web development choice, I still don't understand, practically, how would losing the ability to go back/forward in the browser be an O.K sacrifice? Imagine Facebook without direct page navigation! Is there an essential/direct purpose for SPA I can't get my hands on?

How to implement deep linking client on top of HATEOAS server?

single-page-application,pushstate,hateoas
There's a similar question on SO, but it's not phrased well and it lacks details. So I'm trying to write a better question. I'm interested in how to implement HATEOAS with a single page application (SPA) that is using pushState. I want to preserve deep linking so that users...

back button behavior in angular js application

javascript,angularjs,single-page-application
I have an issue with a SPA app written in angularJS. The application consist of thre views - login view, main view and log out view. myapp/#/login myapp/#/main myapp/#/logout my route provider: function Router($routeProvider) { $routeProvider .when('/login', { templateUrl: 'app/components/login/login.tmpl.html', controller: 'login.ctrl', controllerAs: 'vm' }) .when('/main', { templateUrl: 'app/components/dashboard/main.tmpl.html', controller:...

React with react-router: render component by replacing content in an element

reactjs,single-page-application,react-router
In my app, I am using React.js as my javascript framework, in combination with react-router for navigation. I have a problem in replacing the content of my main container div. When I access some new route, the appropriate route handler is activated calling the render method, but that html is...

Multiple Iterations from One Response

javascript,json,angularjs,single-page-application
I want to show a list of product with details and a list of product's models which is checked at detailed list but I want to do it with only one get request. I mean I will get the json of products and I will use multiple times in page....

Multiple Shells (views and view models) and routers for different type of users in Durandal

shell,single-page-application,durandal,router,composition
So I'm trying to build an app that has two different kind of users, namely customers and sellers. The app is designed in such a way that both of them will have different kind of navigation bars and access to different kind of pages via routes. As such, I'm trying...

Angularjs: ocLazyLoad vs Requirejs

angularjs,requirejs,lazy-loading,single-page-application
I'm working on a big angluar project and obviously we need a way to lazy load our scripts. I've worked with require.js before and it's quite good, but the problem is that after we concatenating and minifying our files, we got a 1.5M js file. So i just encountered OcLazyload...

Can't access element in the same view using AngularJS

angularjs,single-page-application,angularjs-ng-include,ng-view,multiple-views
so in general I want to build a single page application with AngularJS and I want my page to have different content for public and registered users, thus I put my navbar, content and footer part into different views. The structure looks like this: index.html script.js navbar.html content.html footer.html uirouter.html...

3rd Party script in content not loading in Durandal

jquery,knockout.js,single-page-application,durandal-2.0
My question is almost similar in nature to one posted here. I am loading HTML content from my database that contains a third party script. As i have found out Durandal does not load that script or rather the view will not compose that element. My html content(from 3rd party)...

How to serve index.html with web api selfhosted with OWIN

asp.net-web-api,routing,single-page-application,owin
Should be an easy question, just can't find the answer. I have an SPA (AngularJS) with web api which is self hosted with Owin. I use Nancy to serve the page, but I would like to get rid of Nancy and use Index.html as my single page. I've seen this...

RedirectToAction in a single-page application

c#,asp.net,ajax,asp.net-mvc,single-page-application
I have a fairly simple single-page application that uses AJAX to load and replace contents of the page. The application should allow user to add phone numbers to a customer. After user loads a view to add a new phone number by clicking on Ajax.ActionLink on customers page he can...

Angularjs resource with scope parameter

javascript,asp.net-mvc,angularjs,single-page-application
My problem is the following: I am trying to call resource with the following parameter and I get the following error: [$resource:badcfg] I tried fixing this in the past 3 hours and I cant seem to make it work. So, if i call it like this: $scope.komintent = Fakturi.komintenti.get({ id:...

Save json to file in angularjs..? [closed]

json,angularjs,single-page-application
I am new to angularjs and trying create an single page application. I have a home controller with very simple code. It has one button "Get Data" which calls the api and api returns a json data. Now I got the response and I can display the response on html...

Rails + AngularJS + Prerender.io (local server) setup not rendering pages

ruby-on-rails,angularjs,phantomjs,single-page-application,prerender
I am trying to setup Prerender.io server locally. I am Rails + AngularJs app. Already pulled prerender repo and started the server with node. $ export PORT=3001 $ node server.js 2015-03-13T08:15:48.152Z starting worker thread #0 2015-03-13T08:15:48.159Z starting worker thread #1 2015-03-13T08:15:48.161Z starting worker thread #2 2015-03-13T08:15:48.163Z starting worker thread #3...

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

backbone.js,google-analytics,single-page-application,google-adwords,google-tag-manager
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...

Render New Views Within a Div Based on Click of Button | AngularJS

javascript,html,angularjs,webpage,single-page-application
Hi I am trying to render a new view based on clicks of a button in a navbar. However, it is not working. Here is my HTML Code: <!-- Links to all the pages with data entry forms --> <div id="data_links" ng-controller="MainCtrl"> <ul> <li> <a href="#" title="Home Page" ng-click =...

AngularJs SPA with master/detail views: a “slow” approach

javascript,angularjs,single-page-application
My app is a simple AngularJS SPA, which is essentially a contacts manager: the master (landing) page is a list of persons, one per row, in a ng-repeat loop. Each person, clicked, shows the details page: a form with many fields. Currently my router is like this app.config(function ($routeProvider) {...

AngularJS routing not working after site hosted into IIS

asp.net-mvc,angularjs,iis-7,single-page-application,angularjs-routing
We are creating SPA technique using AngularJS in ASP.NET MVC framework,AngularJS routing between pages are working fine when it's run from VS2013,but after hosting the application in to IIS7.5 routing not working, Routing Script: var appRoot = angular.module('main', ['ngRoute', 'ngGrid', 'ngResource']); //Define the main module appRoot .config(['$routeProvider', function ($routeProvider) {...

react server side rendering with client side routing

javascript,reactjs,single-page-application,isomorphic-javascript
An initial server rendering for my homepage route ( / ) works fine. Also, subsequent client side navigation to ( /#/page2 ) works fine. However, if I load /#/page2 directly from the address bar, the server rendered homepage loads in the browser first and then visibly transitions to /#/page2, which...

AngularJS directive not calling function on parent scope

angularjs,angularjs-directive,angularjs-scope,single-page-application
I have a directive that includes an image with a right mouse click event that shows a custom context menu. When the user clicks on an item in this context menu, I want to call a method on the parent controller. I have set up the context menu using Ian...

Should same web api serve both UI SPA and mobile clients?

angularjs,rest,asp.net-web-api,single-page-application,restful-architecture
If we have a SPA App built with angularjs for example that use (REST API) web api service for it's requests is it ok or better qustion is should other mobile clients use same api for theirs request?

i18n: Access locale resolution logic in JavaScript

javascript,localization,internationalization,single-page-application
I'm developing and internationalized Single Page App with 2 sorts of localized text: 'static' text, typically text in my HTML templates. 'dynamic' text, i.e text that lives in the database, typically the description of a product on an e-commerce site. It's type 2 I'm having trouble with. Say my app...

Skip “login.windows.net” and redirect to federated ADFS

single-page-application,claims-based-identity,azure-active-directory,adal,office365-apps
Any suggestion on how to skip the selection of login url (home realm?)

SEO with single page application

node.js,seo,single-page-application
I built a node.js social networking web site for noders but I get some serious problems to improve my SEO factors. How can I make it SEO friendly? And yes, given that it is a single page app, it is a little harder!

.then .done promises not working in durandal spa using knockout and js

jquery,knockout.js,single-page-application,q,durandal-2.0
I am working on a SPA developing in Durandal using Knockout jQuery and Require. My problem is when I make ajax calls to my API I don't actually get my data outside the .then statement(when I substitute my Get method with the line commented out below). However if i work...

AngularJS - Is it Possible to load two different html with two different routers(one for each .html) in one single application?

angularjs,single-page-application,angularjs-routing
I'm having two HTML files -> index.html and start.html So far I was developing an app(a small application) in a single dimensional thought where index.html serves as the main page and app-route serves as the main router for the application. Now we're creating a bigger application like a .com site...

Loading the specific page on Browser Refresh. SPA AngularJS

angularjs,asp.net-web-api,single-page-application
I am creating a new Web API and Angular application. I want to know how we can handle routes on server side. Everything is working fine. I am using ui-router for routing, when i refresh browser that its giving me. HTTP Error 404.0 - Not Found I want to know...

Should I place SPA and RESTful API in different servers?

rest,oauth,single-page-application,restful-authentication
I'm developing a Single Page Application (SPA) and a RESTful API to serve resources to it. Since I'm going to develop mobile applications, and even open the service to third parties in the future I thought of placing the SPA in one server and the REST API in other. I...

How to intercept web url from chrome and add headers to the request?

java,jsp,rest,http,single-page-application
given: my chrome browser hits the following url that renders a single page application web view (index.jsp). url: http://server/dostuff?stuff=123 however, what I want to do is somehow intercept that GET request and tack on a header to it (i.e. X-HIDE-MAIN-FOOTER). if this header is present the code simply hides the...

Can I check for the existence of an HTTP only cookie with Javascript? [duplicate]

javascript,authentication,cookies,servicestack,single-page-application
This question already has an answer here: Check if httponly cookie exists in Javascript 1 answer Can I use Javascript to see if an HTTP-only cookie exists, I don't want to see the value, just know whether or not it is there. I need this because I have an...

Passing Authentication from WebApp to WebAPI using BreezeJS

odata,breeze,asp.net-web-api2,single-page-application,azure-active-directory
I am having two web applications, one a SPA using AngularJS + BreezeJS and the other a WebAPI. We are building authorization in the WebAPI and the results get filtered based on user access. We want the user to sign-in into organization Azure AD in the SPA and pass the...

Angular SPA databinding

angularjs,data-binding,single-page-application
My angular SPA databinding is not updating automatically. Hoping you can tell me why. - This is my JS file: var app = angular.module('SDMApp', ['ngRoute']); app.config(function ($routeProvider) { $routeProvider .when('/para', { templateUrl: 'view/ParaView.html', controller: 'MainController' }); }); app.controller('MainController', function($scope) { $scope.CurrentlyShowing = "Hello"; }); And my html file: <!DOCTYPE html>...

Create session timeout warning for durandal single page application

javascript,model-view-controller,requirejs,single-page-application,durandal
I have a durandal/requirejs single page application. When a user sits idle, I need to display a warning to the user indicating that the session is about to time out. I have looked at several examples on the internet for asp.net apps, but can't find any examples for a single...

How does the Turbo Tax website work without full page postbacks?

jquery,single-page-application
I was looking through the Turbo Tax site (www.turbotax.com) and it appears, once you sign in, only the center panel changes, the other parts remain static and the entire page never does a full page postback. How does this work ? I realize it could be simply jquery ajax, but...

Angular UI Router - Abstract Parent State with empty Url

javascript,angularjs,angular-ui-router,single-page-application
Im trying to set up multiple nested states inside my app. This is the related code. function configFn($stateProvider, $urlRouterProvider) { $urlRouterProvider.otherwise("/cart"); $stateProvider .state('checkout', { url: '/', templateUrl: 'app/checkout/views/checkout.container.html', controller: 'checkoutCntrl', abstract: true }) .state('checkout.cart', { data: { step: 1 }, url: '/cart', views: { "styles": { templateUrl: 'app/checkout/views/checkout.styles.html', controller: 'checkoutStylesCntrl'...

Single Page Application and RESTful API

angularjs,rest,single-page-application,hateoas
A real RESTful API leverages hypermedia so that clients rely only on dynamic hypermedia provided by server to navigate through the application (the concept known as HATEOAS) This concept is easily applicable to web applications but how do you apply it to Single Page Application as SPAs normally manage their...

How to maintain state of page with tabs on browser refresh

extjs,single-page-application,extjs5,browser-refresh
In ExtJs, what is the best way to handle Browser refresh? Say, I've a page with two tabs A and B and the token when tab A is active is #mytoken/:someidforA and the token when tab B is actibe is #mytoken/:someidforB How do we ensure that the page stays in...

AngularJS Tabs don't display HTML Files

angularjs,single-page-application
In my SPA application, I have a view which I need to display tabs. I have the tabs showing up correctly and able to select each but for some reason the html associated with the tabs is not being displayed. They are in the same folder as the calling html...

OAuth2 - Status 401 on OPTIONS request while retrieving TOKEN

spring-security,oauth-2.0,cors,single-page-application,restful-authentication
Our stack uses Backbone as our client-side app and Spring Boot as a RESTful API. We're trying to make basic authentication using OAuth2 with user providing username and password. We use Spring Security for authentication and jQuery $.ajax method for making requests. However the response we get is 401(unauthorized) status...

Backbone.Collection.reset() => child view is out of sync with parent

backbone.js,single-page-application,backbone.paginator
I have a list of items. They are stored in backbone pageable collection. They are displayed like this |---item1---------------------------| |---item2---------------------------| |---item3---------------------------| |---item4---------------------------| |---item5---------------------------| |---item6---------------------------| |---item7---------------------------| << 1,2,3...end >> User can click on individual item to open detail view in a separate page. Detail view has listeners initialized when it's created....

Load JSON into Angular

javascript,json,angularjs,single-page-application
I am new with Angular.js. I try to get json from my local url http://85.96.243.31/admin.productss/searchwithjson. JSON content is: [ { "fullsizeurl": "/uploads/incubout_denemeshop/1/product/3-kdd4eesv-erer-1-cent-1.png", "productid": "3", "price": "0.01", "isactive": 1, "brandid": "1", "subcategoryid": "1", "model": "1 Cent", "isbundle": 0, "subcategory": "Cat2", "taxincluded": 0, "brand": "erer", "thumbnailsizeurl": "/uploads/incubout_denemeshop/1/product/3-kdd4eesv-erer-1-cent-1_thumb.png" }, { "productid": "1", "isactive":...

Angular Js+Asp.net Web api session management

angularjs,asp.net-web-api,single-page-application,javascript-framework
I'm new to both angular and web api, I've worked previously on asp.net web forms and java jsp's my question is since angular is pure js framework and web api is used for Http services ,if we build web applications using both these technologies how can session management be handled,...

AngularJS Loses Selected Item on View Reload (data type of parameter lost)

angularjs,select,angular-ui-router,single-page-application,selecteditem
I'm running into an issue in an Angular SPA where a select is losing the selected item when a view is reloaded. The selected item value is correct. This is a typical search/results scenario, so I must be missing something basic. The angular module (much condensed here) is set up...

Unterminated string constant during @Html.Partial from javascript object

javascript,html,asp.net-mvc,single-page-application
var html = [email protected]("_mypartialview")'; $("#container").html(html); I am working in a single page application and I don't want to hide the container div element; instead I want to load the html content into my javascript object. But I get the error: Unterminated string constant. I have tried various methods without any...

How to bypass routing in Angular UI Router

angularjs,angular-ui-router,single-page-application
I'm creating a web application in which the bulk of the functionality is deployed as an AngularJS single-page application, but there are also a few static content pages that are served in the traditional way. Navigation within the SPA employs Angular UI Router and seems to be working correctly, as...

How to filter records using group functionality in BreezeJs

entity-framework,breeze,single-page-application
I'm developing a client app that uses breezejs and Entity Framework 6 on the back end. I've got a statement like this: var country = 'Mexico'; var customers = EntityQuery.from('customers') .where('country', '==', country) .expand('order') I want to use There may be hundreds of orders that each customer has made. For...

Can we provide two entry points for single page application?

jquery,backbone.js,single-page-application
I am working on a Single Page Application. Our first page is login page where we enter username and password. Now client gave us a new requirement to provide a seperate login page for admin users. There should be an extra drop down list in Admin Login page. They need...

Parse data security and relationships

backbone.js,parse.com,relationship,acl,single-page-application
I'm trying to determine the best approach for the following scenario using Parse and a Backbone front end. I want to build a discussion thread where two or more users, of various roles (ie: member, admin, etc), are able to communicate by posting simple messages which will appear in a...