JavaScript for Line of Business Applications
606.5K views | +22 today
JavaScript for Line of Business Applications
Keeping track of current JavaScript Frameworks that help design your clientside Business Logic Layers.
Curated by Jan Hesse
Beam to my Inbox:
Your new post is loading...
Your new post is loading...

Popular Tags - Filter using the Funnel

Scoop.it!

Authentication in Single Page Applications

Authentication in Single Page Applications | JavaScript for Line of Business Applications | Scoop.it

In this article, we will see how to create URLs secured by a login and a password, in Single Page Applications. I will provide an example using node.js, ExpressJS for the server, and AngularJS for the client.

The concept remains the same for Backbone, or other front-end frameworks.

First of all, we need to know what part of the application to secure. And to know it, we need to roughly understand how a Single Page Application works (although I'm sure you are already familiar with this world).

We are going to code the server with node.js, ExpressJS and PassportJS (a nodejs library to deal with authentication). To make it simple, I created a single file for the entire application.

In the client-side, we need to detect when an AJAX call returns a 401 status (which means that the user needs to authenticate), and display to the user the login form.

With AngularJS, it can easily be done by adding an interceptor to every AJAX calls ...


No comment yet.
Scoop.it!

Getting started with Knockout.js

Getting started with Knockout.js | JavaScript for Line of Business Applications | Scoop.it

Developing a complex and dynamic data-driven web application can be a challenging task. Keeping a user interface in sync with the underlying data normally involves wiring up a number of event handlers to broker information between the various elements and the data whenever any actions are performed by a user or when new data is loaded.

No comment yet.
Scoop.it!

Running KnockoutJS Unit Tests with Chutzpah

Running KnockoutJS Unit Tests with Chutzpah | JavaScript for Line of Business Applications | Scoop.it

While unit testing our ViewModel was all working great, the real icing on the cake is getting JavaScript unit testing working without a browser, integrated into Visual Studio. And it would be even better if the test runs and results could be integrated into the Visual Studio Test Explorer. That’s where two separate Visual Studio extensions come in to play: the Chutzpah JavaScript Test Runner and the Chutzpah Test Adapter for Visual Studio. Both can be installed directly from the Extensions and Updates window in Visual Studio.

No comment yet.
Scoop.it!

AngularJS and SEO - Part 2 - Title and meta description

Getting your site in the Google and Bing index may be the most important step but you still need to optimize your content for searchability.

e.g. you will have to deal with title tags and meta description for each page in order to rank well.
There is nothing built in for AngularJS to deal with this, so we had to roll our own directives for this.

No comment yet.
Scoop.it!

You minified my AngularJs!

You minified my AngularJs! | JavaScript for Line of Business Applications | Scoop.it

So as you know I have been very interested in AngularJs lately and have been absorbing as much knowledge as I can on the subject. The application we are developing at work is getting close to beta so we began to look into bundling and minification of our JavaScript.

No comment yet.
Scoop.it!

Mixing Static Content With ngSwitch And ngSwitchWhen In AngularJS

Mixing Static Content With ngSwitch And ngSwitchWhen In AngularJS | JavaScript for Line of Business Applications | Scoop.it

With AngularJS, you cannot mix static content in with ngSwitchWhen elements inside of your ngSwitch container. Executing a switch-statement like this makes sense when you're dealing with a scripting context; however, when you're building and HTML DOM tree, this limitation can feel somewhat unnecessary. And, it doesn't have to be that way. The only reason it doesn't work now is because the ngSwitchWhen and ngSwitchDefault directives don't report their anchoring element - they only report their transclude functions. If, however, we tweak the code to keep track of the various anchoring elements, ngSwitch can easily contain both static and dynamic content.

No comment yet.
Scoop.it!

Convention-based routing in AngularJs

Convention-based routing in AngularJs | JavaScript for Line of Business Applications | Scoop.it

In Umbraco 7, we've setup routing conventions in AngularJs, pretty much the same way as asp.net mvc has them defined. This gives us a lot of advantages, and a flexible routing system that doesn't need any additional entries as our application grows.

So out of the box, AngularJs comes with a routing configuration, where you've been able to return different view paths and map these to certain Url patterns.

This is basic Angular routing, but one of the new things in 1.1.x branch (current 'unstable' version) is that you can return thetemplateUrl as a function instead of a string, so you can do more dynamic things like so:...

No comment yet.
Scoop.it!

Sites for Learning How to Code

Sites for Learning How to Code | JavaScript for Line of Business Applications | Scoop.it

Coding was once considered to be a nerdy pursuit. But in truth, learning to code not only opens a wide range of lucrative career paths, it is excellent for logic and problem solving skills. In fact, the new national curriculum for England now requires children as young as five learn to write and develop computer programs.

Many kids already have an innate aptitude for coding, but haven't had an opportunity to do so. Here are some websites to get your child going. They're either free or are free to try.

No comment yet.
Scoop.it!

Browser Wars: Websockets vs. AJAX

Browser Wars: Websockets vs. AJAX | JavaScript for Line of Business Applications | Scoop.it

This is the first in a series of articles on Building Realtime HTML5 Apps. I recently created a new framework called bone.io, and I wanted to share my thoughts and ideas on building realtime web applications.

This series is going to be less of a how-to guide, and more of a 30,000 foot view of the realtime web and the potential for the next generation of web applications.

No comment yet.
Scoop.it!

Advantages of using MongoDB in a Single Page Web Application

In a Single Page Web Application, much of the data that is in active usage is stored on the client side, reducing the amount of chatter that needs to happen over the wire. In the client, this data is stored in JSON. In a Single Page Web Application, much of the communication between the client and server is done over AJAX, with data transmitted in JSON strings. Because the data is transmitted and stored and used in the same format, there is no impedance mismatch requiring marshalling data from one format to another. This results in both quicker development and execution time.

No comment yet.
Scoop.it!

Simple User Settings with Ember Data

Your application needs user settings. You need to persist some sort of structured data that decides how the application should function. This is a common use case. Ember-Data (shockingly depending on who you are) makes this easy.

Here are some assumptions:

* You have POST /settings as well as GET and PUT routes.

* The server just saves whatever data is sent w/o any processing or other handling.

* There may be any number of complex objects representing settings.


It's easy to begin.

No comment yet.
Scoop.it!

Rich HTML/JS Applications with Knockout.js and No Server

Rich HTML/JS Applications with Knockout.js and No Server | JavaScript for Line of Business Applications | Scoop.it
Steven Sanderson explains how to write abstract and testable application logic without any DOM clutter with Knockout.js and how Knockout automatically updates app’s UI whenever needed.
Jan Hesse's insight:

with video and slides

No comment yet.
Scoop.it!

Binding Checkboxes with KnockoutJS

Binding Checkboxes with KnockoutJS | JavaScript for Line of Business Applications | Scoop.it

Recently I had occasion to bind a list of checkbox input elements to a KnockoutJS observableArray.  It actually took me a great deal of time to get the implementation working.  In this post I am going to cover the issues I experienced.  Then I will explain how implement a surefire checkbox-KnockoutJS binding solution.  This post assumes you have a working knowledge of KnockoutJS.

No comment yet.
Scoop.it!

PhoneJS - HTML5 JavaScript Mobile Development Framework

PhoneJS - HTML5 JavaScript Mobile Development Framework | JavaScript for Line of Business Applications | Scoop.it

PhoneJS is a cross-platform HTML5 mobile app development framework that was built to be versatile, flexible and efficient. PhoneJS is a single page application (SPA) framework, with view management and URL routing. Its layout engine allows you to abstract navigation away from views, so the same app can be rendered differently across different platforms or form factors. PhoneJS includes a rich collection of touch-optimized UI widgets with built-in styles for today’s most popular mobile platforms including iOS, Android, and Windows Phone 8.

To better understand the principles of PhoneJS development and how you can create and publish applications in platform stores, let’s take a look at a simple  demo app called TipCalculator. This application calculates tip amounts due based on a restaurant bill.

* PhoneJS Application Layout and Routing
* PhoneJS ViewModel
* PhoneJS Views
* Start, Debug and Build for Stores
* Creating Store Ready Applications Using PhoneJS and PhoneGap

No comment yet.
Scoop.it!

Callable entities in ECMAScript 6

Callable entities in ECMAScript 6 | JavaScript for Line of Business Applications | Scoop.it

In ECMAScript 5, functions do triple duty:

  • As normal functions: you can directly call functions.
  • As methods: you can assign a function to the property of an object and call it as a method, via that object.
  • As constructors: you can invoke functions as constructors, via the newoperator.

The three main problems with this approach are:

  1. It confuses people.
  2. You can use a function the wrong way, e.g. call a constructor or a method as a normal function.
  3. Functions used as normal functions shadow the this of surrounding constructors or methods [1]. That’s because this is always dynamic (provided by each function call), but should be lexical in this case, like normal variables that are resolved via surrounding scopes if they are not declared within a function.

Let’s first look at ECMAScript 6’s callable entities and then at how they help with these problems.

No comment yet.
Scoop.it!

AngularJS Missing Directives: Native Form Resets

AngularJS Missing Directives: Native Form Resets | JavaScript for Line of Business Applications | Scoop.it

Lets jump in and take a look at form resets. If you have been developing for the web for any period of time you know that there is a native INPUT element type that will reset all form input elements (including selects, textareas, etc.) to their original values. The following fiddle has a simple form that includes a native reset button and an Angular controller to initialize the model ("myModel").

No comment yet.
Scoop.it!

AngularJS and SEO - Part 1 - Get your JS site indexed

In this series we will go through a few steps on how to make your AngularJS site crawlable by google and other search engines.
Note: This part does apply to Knockout, Backbone and other frameworks to.

For this series we can safely say that googlebot and bingbot does NOT execute AngularJS and you will have to deal with this manually.

The fact that there is push state and javascript involved on the client side is completely beside the point, server side content and URL’s that resolve is what matters.

No comment yet.
Scoop.it!

Structuring an Angular Project

Structuring an Angular Project | JavaScript for Line of Business Applications | Scoop.it

We can build amazing SPA and HTML5 applications when choosing a powerful framework like Angular, Durandal, Ember, or Backbone. And while I love my personal favorites Angular and Durandal, it’s not all magic. There is a learning curve and some things are really important to decide up front. Once you choose your framework, you should decide how you will organize the structure of your project.

In this post I’ll show how I organize my Angular based projects and discuss why I like it.

No comment yet.
Scoop.it!

Ember Tools - A Rails like Approach

Ember Tools - A Rails like Approach | JavaScript for Line of Business Applications | Scoop.it

Ember Tools is a rails like approach in generating skeletons for your Ember application. Generated code lets you understand certain concepts as you don’t have to lookup specific samples on how to implement a certain feature using Ember. Ember tools will be installed via npm and are ready to go. jQuery, Ember, Handlebars and Ember-Data is installed out of the box.

To create an app you simple generate it via ...

No comment yet.
Scoop.it!

Preventing duplicated requests in AngularJS

Preventing duplicated requests in AngularJS | JavaScript for Line of Business Applications | Scoop.it

You know the case when you hit submit button quickly enough that it sends the form twice? Or when you hit submit button and it seems that nothing happens, so you click it once again and another request is being fired? Duplicated requests issue - you can experience it in both traditional web application as well as in modern so-called Single Page Applications. I’d like to show you how it can be handled in AngularJS and how we did it in Codebrag.

No comment yet.
Scoop.it!

twitter bootstrap and angularjs directives

twitter bootstrap and angularjs directives | JavaScript for Line of Business Applications | Scoop.it

The past few days, I’ve been experimenting with angularjs. It’s an awesome javascript MVC framework and I recommend checking it out if you haven’t!
One of its features are directives which, among other things, allow you to replace html elements with a specific tag name or attribute name with a template and adjust their behaviour. This is nice if you have complex HTML structures in a website which repeat themselves.
Another awesome thing I’ve already posted about is twitter bootstrap, so I thought I would make some angularjs directives for bootstrap harder that I have difficulty remembering.

No comment yet.
Scoop.it!

Deferred Objects

Deferred Objects | JavaScript for Line of Business Applications | Scoop.it

A Deferred object is a mechanism for referencing a value which may (or may not) be available at a later point.

Every so often you might require a group of operations to complete before you continue. These operations might need to happen either in sequence or in any order, but they all have to finish before the code can continue.

Ajax requests are the best examples of Deferred Objects because they're so commonly used. But some other cases for Deferred Objects include file access, web workers or other asynchronous calls.

An interesting use I've toyed with is user interaction. Embedded below is an example that shows how to combine deferred objects with mouse events to create a simple mouse dexterity game.

No comment yet.
Scoop.it!

Debounced and Throttled Observers in Ember.js

Debounced and Throttled Observers in Ember.js | JavaScript for Line of Business Applications | Scoop.it

Often in complex ember apps you want to use debouncing and throttling, to avoid doing expensive processing or too many server requests. I had hacked together a solution for this with underscore, but then I found out that Ember.js includes built in throttle and debounce functions. A few minutes later, I came up with these handy little helpers:

No comment yet.
Scoop.it!

Backbone.js Tips And Patterns

Backbone.js Tips And Patterns | JavaScript for Line of Business Applications | Scoop.it

In this article, we’ll explore different design patterns that you can use in your Backbone.js applications, and we’ll look at many of the common gotchas that trip up developers.

* Perform Deep Copies Of Objects
* Create Facades To Objects
* Store Data Not Persisted By The Server
* Render Parts Of Views Instead Of Entire Views
* Keep Models Agnostic To Views
* Parameter Mapping In Routers
* model.fetch() Won’t Clear Your Model
* PUTs Require An ID Attribute
* Model Data On Page Load
* Handling Failed Model Attribute Validation
* HTTP Status Code 200 Trigger Error
* Create A Generic Error Display
* Update Single-Page App Document Titles
* JSDoc Functions And Backbone.js Classes
* Practice Test-Driven Development


No comment yet.
Scoop.it!

Learn AngularJS this Weekend

Learn AngularJS this Weekend | JavaScript for Line of Business Applications | Scoop.it

AngularJS has a reputation for a steep learning curve. It’s definitely complex, but follows the 80/20 rule. 20% of the features are what you will use 80% of the time. If you are new to AngularJS and have a weekend to study, there are some very high quality resources that will let you start Monday with a strong working knowledge of AngularJS.

Already know AngularJS? Feel free to skip ahead. These resources are excellent, and you’re bound to learn something.

No comment yet.