JavaScript for Line of Business Applications
606.6K views | +21 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!

Intermediate Ember Controller Concepts

Intermediate Ember Controller Concepts | JavaScript for Line of Business Applications | Scoop.it

I’ve been finding issues in an Ember application I’m working on where the author (me) didn’t fully grasp Ember controllers. Here are a few controller concepts I’ve learned.

Controller Concepts
* A controller is a decorator for your models. It proxies all the get and set calls to the underlying model unless that property is defined on the controller itself.
* Controllers are fleeting, but models are forever (if you’re taking an Ember Data-like approach). As you route around your application, controllers will be destroyed so don’t count on them surviving very long. An exception to this is the immortal application controller.
* You don’t necessarily need a controller, especially if you’re not holding onto application state. The router events object is a great place to save, create, and delete models.

No comment yet.
Scoop.it!

Variable templates for an AngularJS directive

Variable templates for an AngularJS directive | JavaScript for Line of Business Applications | Scoop.it

Sometimes web services and APIs return different data sets for the same type of object. For example, the tumblr API will return a list of posts, but each post type has different data associated with it: text posts have a title and body, while photo posts have captions and images.

Since having different components and directives for each post type doesn't make much sense (especially when they're all displayed in one stream, as on tumblr), it's beneficial to be able to conditionally load a template based on the post type of each individual post.

No comment yet.
Scoop.it!

HTML5 Can't Do That

Slides from a presentation I put together for the Web Afternoon, Front Porch, and Thunder Plains conferences.

Highlights of Durandal.js — Built on KO, picks up where it left off — Routing: based on changes to URL — View/state change transitions — Async data fetching, with Promises — Manage code modules with Require.js — Enforces consistent code structure

No comment yet.
Scoop.it!

Facilitate use of RequireJS in AngularJS with angularAMD

angularAMD simplifies the use of RequireJS in a AngularJS webapp, optionally supporting on-demand loading of 3rd party modules such as UI Bootstrap.

To see it in action, open your favorite Developer Tools for your browser and see controller and service javascripts being loaded as you changes the tab.

No comment yet.
Scoop.it!

Using Ember.js with jQuery UI

You can also define some code to run every time an element is rendered. You can use this hook to wire up any JavaScript library to the element that Ember has created. 

All Ember views have a $ function, which is the normal jQuery function, scoped to the current element. You can also call this.$() to get back a jQuery object wrapping the element itself.

You can use this hook to do anything you want, allowing you to hook in any library you want. You would use this hook a lot like you’d use a jQuery(document).ready hook, but scoped to the view being created.

Ember also provides a willDestroyElement hook, which you can use to tear things down that you set up when the element was inserted. This is relatively rare, and is mostly used when interfacing with another toolkit that requires a teardown, or to tear down custom Ember observers.


No comment yet.
Scoop.it!

Ember.js Concepts for Rails Developers

Ember.js Concepts for Rails Developers | JavaScript for Line of Business Applications | Scoop.it

Moving from a full stack framework like Rails to a front end framework like Ember.js is less of a leap than you might anticipate. You’re probably already using jQuery for some elements of interactivity, but at a certain point, you came up against that wall of maintainability and ended up with a hearty serving of front end spaghetti code. Yum. Here’s where a frontend framework can help, but this can cause a different kind of confusion.

Of course, switching from Rails to a front end framework presents you with a new set of tools, many of which have the same names as the ones you are already familiar with. This really comes to a head with the issue of how responsibilities are delegated, so let’s have a Rails vs Ember.js comparison of the two frameworks to clear this up.

No comment yet.
Scoop.it!

httpinvoke - small, no-dependencies HTTP client library with a promise-based callback API

httpinvoke - small, no-dependencies HTTP client library with a promise-based callback API | JavaScript for Line of Business Applications | Scoop.it

httpinvoke is a 4.6kb no-dependencies HTTP client library for browsers and Node.js with a promise-based or Node.js-style callback-based API to progress events, text and binary file upload and download, request and response headers, status code.

Gracefully upgrades to latest platform-specific features:
* cross-origin resource sharing - do cross-domain requests with confidence;
* progress events - get current and total bytes downloaded or uploaded;
* binary file uploads and downloads - easily use Blob, FormData, ArrayBuffer, Uint8Array or a simple array of bytes.
* Supports both NodeJS style callbacks and Promises/A+ (with progress events, see an example).
* Supports transparent gzip/deflate content decoding.
* Handles HTTP responses The Right Way™:

No comment yet.
Scoop.it!

AngularJS, Phonegap, and angular-seed. Let's Go!

AngularJS, Phonegap, and angular-seed. Let's Go! | JavaScript for Line of Business Applications | Scoop.it
A guide through how I was able to use the angular-seed and phonegap projects to start myself on the path to my first mobile application.

In my exploratory phase with angular, I had discovered the angular-seed project and angular-phonecat tutorial. I knew angular-seed would start me out with runnable jasmine unit tests, an end-to-end suite, a web-server, and some other niceties. That’s when I got the bright idea that I should just make angular-seed run as a phonegap app! 8 hours later…

If you follow this guide I think you can have angular-seed running in the XCode simulator in less than 30 minutes. Exciting right? I know.

No comment yet.
Scoop.it!

Unit Testing Ember Data Models

Ember.js is a JavaScript MVC framework for creating ambitious web applications and is one that, along with the Ember Data library's models, SoftLayer uses for its projects. The "M" in MVC stands for model which is the most important layer in an application, for if the data models are not correctly architected anything built on top of them will inherit their deficiencies. While this post is not going to discuss how to architect your data models in Ember.js it is going to propose a way in which you can Unit Test your model's definitions so that you keep any incongruent changes from being introduced into them.

When we write our Unit Tests we want them to be able to completely test the definition of our data models. This includes properties, their type, any relationships they have with other data models, the generated result of any computed properties and the properties computed properties are observing. 

No comment yet.
Scoop.it!

Developing mobile apps with Node.js and MongoDB, Part 2: Hints and tips

Developing mobile apps with Node.js and MongoDB, Part 2: Hints and tips | JavaScript for Line of Business Applications | Scoop.it

Get implementation details on using Node.js (server-side JavaScript), rather than Java technology, to develop systems of engagement. In this article, the IBM Extreme Blue team who developed a RESTful backend application using Node.js and MongoDB shares their thought process and recommendations.

In this article, we share lessons we learned in the process of developing a RESTful backend application using Node.js and MongoDB. We highlight our thought process in several high-level design and implementation decisions. We'll cover these topics:
* Leveraging NPM (Node Packaged Modules)
* Understanding asynchronous programming
* Structuring a large Express.js application's routing configuration
* Application-level logging
* Approaching data persistence and modeling
* Solving Passbook-specific challenges including cryptographic functions not supported by Node
* And we address subtle "gotchas" in hopes of expediting the learning process for those interested in Node.js and MongoDB development:
* Don't make assumptions about objects or their properties in a dynamically typed language
* Avoid implicit control flow
* Understand your dependencies' behavior

No comment yet.
Scoop.it!

WearScript - JS with Batteries Included for Google Glass

WearScript - JS with Batteries Included for Google Glass | JavaScript for Line of Business Applications | Scoop.it

WearScript is a library that allows you to execute Javascript on Glass that can interact with the underlying device (e.g., control/sample sensors/camera, send timeline items, draw on the screen). We have gone through many iterations to develop a streamlined user experience to write code and execute it on Glass, and I think we are very close. This is much simpler than Android development, but more powerful than the built-in browser. The features we are releasing today are sufficient to make a wide range of applications, but if you've seen our previous videos you can be sure there is more to come. With your help we can build an open ecosystem around Glass. Watch the short Intro Video to see what it can do.

No comment yet.
Scoop.it!

JavaScript FUNdamentals

JavaScript FUNdamentals | JavaScript for Line of Business Applications | Scoop.it

Programming languages like BASIC, Python, C has boring machine-like nature which requires developers to write extra code that’s not directly related to the solution itself. Think about line numbers in BASIC or interfaces, classes and patterns in Java.

On the other hand JavaScript inherits the best traits of pure mathematics, LISP, C# which lead to a great deal of expressiveness (and fun!).

JavaScript allows programmers to focus on the solution/problem rather that to jump through hoops and API docs.

* Loose Typing
* Object Literal Notation
* Functions
* Arrays
* Prototypal Nature
* Conventions
* Modules
* “this” Keyword
* Pitfalls
* Further Learning


No comment yet.
Scoop.it!

Web Development Trends: Mobile First, Data-Oriented Development, and Single Page Applications

Web Development Trends: Mobile First, Data-Oriented Development, and Single Page Applications | JavaScript for Line of Business Applications | Scoop.it

There are a million things that could be covered for this type of talk (HTML5 anyone?) but I only had 60 minutes and couldn’t possibly cover them all so I decided to focus on 3 key areas: mobile, data-oriented development, and SPAs. The talk was geared toward introducing people (many who weren’t Web developers) to topics such as mobile first development (demos showed a few tools to help here), responsive design techniques, data binding techniques that can simplify code, and Single Page Application (SPA) benefits. Links to code demos shown during the presentation can be found at the end of the slide deck.

No comment yet.
Scoop.it!

Bookmarkable ExtJS application with BackboneJS

Bookmarkable ExtJS application with BackboneJS | JavaScript for Line of Business Applications | Scoop.it

Browser bookmarks are useful. Users expect to save the state of a web application by simply copying the application URL. Unfortunately, this feature is not easy to implement on Single Page Applications. In this kind of application, we don't have real page transitions. Due to the fact that the HTML is built by the JavaScript framework directly on the browser, the framework needs to access the browser address bar and figure out how to represent that URL in HTML code. It needs to match what is defined in the address bar and the actual state of the application.

ExtJS provides the Ext.History object. It gives the ability of using hash based history. It means that the address bar will have a hash value (everything after the “#” character) that is not handled by the server. BackboneJS also supports hash fragments, but it can use the Html5 history if available. It means that BackboneJS can use cleaner URL addresses. Our application will be an ExtJS MVC application that uses BackboneJS to handle the URL in the address bar.

No comment yet.
Scoop.it!

Responsive website using AngularJS

Responsive website using AngularJS | JavaScript for Line of Business Applications | Scoop.it

In today’s tutorial, I’m going to show you the process of creating almost an entire website with a new library – AngularJS. However, firstly, I would like to introduce to you the AngularJS.

Using this framework allows us to clearly distinguish between templates (DOM), models and functionality (in controllers). Let’s come back to our template, take a look at our result...

No comment yet.
Scoop.it!

Semantic-UI & AngularJS - Basic Registration Form with Validation

Semantic-UI & AngularJS - Basic Registration Form with Validation | JavaScript for Line of Business Applications | Scoop.it

The idea is that Semantic is a more fluent and structured way to writing a web application, rather than naming stuff poorly like Bootstrap does with things like col-lg-4, Semantic opts for column. This is both good and bad. The examples on their homepage are more semantic, but at the cost of either writing less or more code in order to describe the UI elements in the markup.

You end up writing lots but instead of shifting around in CSS to figure out how to move it from left to right, I just described it. Sure enough, button sat on the right hand side!

Things used in this demo1. Semantic UI2. AngularJS3. NancyFX

Nothing is complete without Nancy, but I'm not showing any Nancy stuff. I'm including it in-case I show the server side stuff.


No comment yet.
Scoop.it!

Decorating your tests in AngularJS

Decorating your tests in AngularJS | JavaScript for Line of Business Applications | Scoop.it

We’ve been using AngularJS at MuleSoft for building our upcoming web-based developer tools and so far we have really enjoyed using it. One area that’s really important to us as developers is unit testing our JavaScript code.This ensures we deliver high quality code that is easy to maintain and refactor and allows us to ship features quickly with confidence Decorators in Angular are really useful for unit testing your Angular JavaScript code. This post is an example of how you can use them to to use them to create great unit tests.

No comment yet.
Scoop.it!

Learning from Javascript Libraries

Learning from Javascript Libraries | JavaScript for Line of Business Applications | Scoop.it
Learning from Javascript libraries by Trevor Landau is a talk on interesting patterns that popular libraries like jQuery, Backbone, Angular, and more use to solve problems.

jQuery runs on approximately 50% of all websites and is the de facto standard for DOM manipulation. Most front end developers use it, but how well do they understand what’s happening when they use the API? How does a library take on the problems it solves? What are the reasons behind some of the techniques it uses? Observing the code under the hood of a library/framework is a fantastic way to become a better developer and thereby user of that library/framework. Better understanding of design patterns in some of the most popular libraries can open opportunities to contribute and be a better open source citizen.

No comment yet.
Scoop.it!

Preventing Navigation in an AngularJS Project

New technologies bring new solutions to problems. Sometimes, however, they also bring old problems back. One of these old problems for AngularJS is interrupting navigation in a web application.

It used to be that you could hook into the approriate window event (onbeforeonload) and be done with it. Unfortunately, AngularJS introduces the idea of a single-page app in which you never donavigate away from that page (and thus the window.onbeforeonload event will never fire). Complicating the matter is the fact that when you’re developing within an angular application that you’re relying on the angular framework to provide you with a solution.

What’s a poor developer to do?

No comment yet.
Scoop.it!

AngularJS native drag and drop

AngularJS native drag and drop | JavaScript for Line of Business Applications | Scoop.it

I recently needed to add drag & drop functionality to an angularjs web application I’m working on, none of the existing directives did exactly what I needed so I built my own. In building the directive, I needed a service to create UUIDs, so I built one of them too.

Design Goals
* Provide a mechanism to respond to a user dragging one element onto another
* No dependency on external frameworks
* No html template
* Applied via attribute
* Use native HTML5 drag & drop api

No comment yet.
Scoop.it!

Yadda, WebdriverJS, Mocha: A BDD test framework using JavaScript

Yadda, WebdriverJS, Mocha: A BDD test framework using JavaScript | JavaScript for Line of Business Applications | Scoop.it

As part of Shazam’s BDD process, the Web team decided to start including automated acceptance test writing during the development process, with each developer in the team writing their own acceptance tests.


As we’re a team of both front and back end developers, it was important to find a language that we all felt confident using. JavaScript was an obvious choice for this. We then had the challenge of finding a framework that incorporated BDD feature files written in natural language with automated tests written in JavaScript. After trying out a couple of different options, we finally settled on a stack using Yadda for our feature files and parsing, withWebdriverJS for browser automation, and Mocha for test wire-up. The decision to use these libraries came after some trial-and-error, and we had variety of reasons for choosing these particular components for our new automation framework.

No comment yet.
Scoop.it!

AngularJS CRUD Grid v5: Now with Dynamic Columns

AngularJS CRUD Grid v5: Now with Dynamic Columns | JavaScript for Line of Business Applications | Scoop.it

Here’s how I built a quick single entity CRUD grid with AngularJS, WebAPI, Entity Framework, Bootstrap, Font Awesome & Toastr.  I spent a more time than I should have getting this all wired up, so I thought I’d share the code to save you some time. 

Jan Hesse's insight:

Starting post of the evolving series:

http://blog.jongallant.com/2013/05/angularjs-webapi-ef.html

No comment yet.
Scoop.it!

Building Web Apps With Yeoman And Polymer: Scaffold your webapps with modern tooling

Building Web Apps With Yeoman And Polymer: Scaffold your webapps with modern tooling | JavaScript for Line of Business Applications | Scoop.it

Tooling for scaffolding Polymer web apps

As I mentioned earlier, Polymer is a library of polyfills and sugar which enables the use of Web Components in modern browsers. The project allows developers to build apps using the platform of tomorrow and inform the W3C of places where in-flight specifications can be further improved.

generator-polymer is a new generator for Yeoman that helps you scaffold out Polymer apps using Yeoman, letting you easily create and customize Polymer (custom) elements via the command line, and import them using HTML Imports. This saves you time by writing the boilerplate code for you.

No comment yet.
Scoop.it!

es6 generators and iteration in spidermonkey

It is my great pleasure to announce that SpiderMonkey, the JavaScript engine of the Firefox browser, just got support for ES6 generators and iteration! As I have written before, generators are functions that can suspend. SpiderMonkey has had generators since Firefox 2 (really!), but the new thing is that now their generators are standard, and available by default. No need to futz with Firefox-specific "language versions".

Generators are a kind of coroutine, and coroutines work well for asynchronous computation. But that's not all that coroutines are good for. Another great application of generators is in iteration, where you have a producer that knows how to produce values, and a consumer that knows how to process them. Being able to write the producer as a coroutine is great win.


No comment yet.
Scoop.it!

Searching using Array.prototype.reduce

Searching using Array.prototype.reduce | JavaScript for Line of Business Applications | Scoop.it

Searching for a particular element in a JavaScript array is often carried out using a typical iteration. In some cases, forEach and some can be used as well. What is often overlooked is the potential use of Array.prototype.reduce to perform such an operation.

Let’s take a look at the following problem: find the longest string in an array of strings. An imperative solution looks something like the following code (usingforEach may simplify the loop but the idea remains the same): ...

A version which relies on reduce is a single statement: ...

No comment yet.