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

Angular Directive Examples

Angular Directive Examples | JavaScript for Line of Business Applications | Scoop.it

Directing Angular Directives
Over the last few months, I've been digging into the Angular framework. One of the things that I really like about Angular, and hope to learn to use extremely well as I progress, is their notion of a "Directive". Directives provide a means for extending both the semantic meaning and functionality of your markup. There are many different ways to implement directives, and the documentation on the angular site is still a work in progress, so I would like to share how I've used them up to this point.

The Goal: Creating a reusable donut chart and legend
First, we have to think about how we're going to get data to feed to the chart. So, I created a quick module that contains a "Product Line", which contains "Products". The plan is to be able to use a single controller and view to be able to see a donut chart and legend for both a single Product, and the full Product Line.
Each Product has a raw goods cost, shipping cost, and markup amount. The singleton that is the Product Line has a way to get aggregated data from all products, for viewing overall costs in those categories. I then created a service for my angular app to interact with this module.

No comment yet.
Scoop.it!

AngularJS Tutorial: Learn to Build Modern Web Apps

AngularJS Tutorial: Learn to Build Modern Web Apps | JavaScript for Line of Business Applications | Scoop.it

This tutorial will guide you through the process of creating a full-stack application. It features step-by-step instructions on how to build a fantasy football application, code snippets of the full application, and explanations on design decisions.

Our intention is to provide the AngularJS community with instructions on how to use AngularJS correctly and effectively, but also in its most modern form. The application you are building will go beyond basic use of AngularJS, and we will attempt to explore as much of the framework as possible. We also feel strongly about maintaining modernity in a tutorial, so we will keep it congruent with AngularJS as the framework and community matures. This tutorial is built on top of AngularJS v1.2.0rc1.

The tutorial is a living thing, a work in progress. We are constantly extending the tutorial and making changes and corrections. If you find errata, think something should be changed, or would like to suggest an improvement or new section, we would love to hear from you.

Jan Hesse's insight:

What a great walkthrough! Highly recommended!

No comment yet.
Scoop.it!

AngularJS Modules for Great Justice

AngularJS Modules for Great Justice | JavaScript for Line of Business Applications | Scoop.it

AngularJS modules are the core means by how you define the components in your app. Besides defining your components, modules provide a way to indicate the dependencies your components require and they help you organize your components to help you write modular code that can be re-used across applications.

As long as I have been developing with AngularJS there has always been the great best practices debate over how to structure your application. Do you use a package by feature or package by layer approach?

Both have their advantages and disadvantages so let’s take a quick look at each before we get into how to implement each using AngularJS.

* Package by Feature
* Package by Layer
* Tiny to Very Large Projects
* Use What Works Best for Your App
* Where Do I Put My Unit Tests?
* The Wrap Up

No comment yet.
Scoop.it!

What is the MEAN stack?

What is the MEAN stack? | JavaScript for Line of Business Applications | Scoop.it

Over the past few weeks I talked to a lot of people and the question I got asked the most was ‘What is the MEAN stack?’ That’s a very legitimate question and in this post I will try to describe my understanding of the MEAN stack and hopefully provide you with a clear understanding on what this new acronym is and how you can set it up on your own.

MEAN is an abbreviation and encompasses some new technologies, namely MongoDB, ExpressJS, AngularJS and NodeJS. The way this stack functions is similar to how the LAMP stack/framework works – let’s do a comparison between the two them:

No comment yet.
Scoop.it!

Events & Actions in Ember.js

Events & Actions in Ember.js | JavaScript for Line of Business Applications | Scoop.it
Understanding events & actions (and the differences between them) will help you build cleaner, more maintainable Ember.js apps.
No comment yet.
Scoop.it!

Building minification-safe Angular.js applications

The first time I pulled up my text editor and starting working with Angular.js minifcation wasn't on my mind. Playing with Angular's cool features took precidence, and dependency injection was a very new concept to me. Of course, as my application grew and I began to think about compiling and compressing my javascript, I was presented with a fun plethora of javascript errors and missing providers. What happened? It all comes down to dependency injection and the way Angular handles internal dependencies.

You see, when you create a controller, directive, modules, service, etc. (basically anything where you can inject dependencies) Angular runs the parameters of your function through its registered components and looks for matches.

This is how most of us learn to use Angular, and it works great until we try to run it through uglify or minify to compress the code. If you know how minifcation works, it should be pretty obvious what happens. The first example above may compile to look a little like this (I've expanded the code back to readable JS to make it readable) ...

No comment yet.
Scoop.it!

hapi - Server Framework for Node.js

hapi - Server Framework for Node.js | JavaScript for Line of Business Applications | Scoop.it

A rich framework for building web applications and services. hapi is a simple to use configuration-centric framework with built-in support for input validation, caching, authentication, and other essential facilities.hapi enables developers to focus on writing reusable application logic instead of spending time building infrastructure. The framework supports a powerful plugin architecture for pain-free and scalable extensibility.

Hapi is a framework for rapidly building RESTful web services. Whether you are building a very simple set of RESTful services or a large scale, cache heavy, and secure set of services, hapi has you covered. Hapi will help get your server developed quickly with its wide range of configurable options.

No comment yet.
Scoop.it!

Turn that "Grunt" upside down!

Turn that "Grunt" upside down! | JavaScript for Line of Business Applications | Scoop.it

Grunt is a build tool for JavaScript projects. It automate all the annoying tasks so you don't have to think about them. a few common examples are linting, assets minification, compiling stuff (coffeescript, stylus, etc) and running your tests on code change. 
It's open source and available on github. This is Grunt's website.

In this blog post I want to show you how to install it and how to automate a few common tasks. 
Hopefully it will convince you to drop everything you are doing and you'll find yourself adding grunt to your current project.

JavaScript is a wild language. you can twist and bend it to your needs but you can easily shoot yourself in the foot. 
Javascript Lint is a tool that checks for common mistake in your codebase. it will be nice to use lint and get errors from all the Javascript files in my project. In addition for lintinting, I want to concatenate the JavaScript files into a single file, and minimize that file.

* Installing Grunt
* Lint, concatenate and minimize our JavaScript files
* Compiling stylus files into css
* Minimize css files
* Watch for file changes and do stuff
* Summary


 

No comment yet.
Scoop.it!

We should all just decide on JavaScript and solve the interesting problems instead

We should all just decide on JavaScript and solve the interesting problems instead | JavaScript for Line of Business Applications | Scoop.it

Our endless bickering over the merits of different languages and paradigms isn’t all that productive, nor is it very interesting. You’re not a Ruby/C#/Java/Elixir developer, you’re a goddamn problem solver. Remove the programming language from your LinkedIn/Twitter bio, that’s not who you are.

All the things that make other languages and platforms more or less sexy are 90 % community and culture. All the loudmouths in the developer community hype things that aren’t “enterprise”. So only 10 % of the sexiness is the actual language*. And the goods news are that we humans can change culture, that’s what we do best when we really want to.

We’re now at the stage when JavaScript is hugely popular and a lot of innovation is taking place in that community. Also, it’s a pretty open language, i.e. it’s not owned by Oracle, Microsoft or IBM. We have the chance of running the same language on the front-end and the back-end. Heck, you can even use it as an officially supported language to write FirefoxOS, Ubuntu Touch and Windows 8 desktop/phone apps.

No comment yet.
Scoop.it!

knockout.sync.js - Sync library managing models to be in sync between devices and backends

knockout.sync.js - Sync library managing models to be in sync between devices and backends | JavaScript for Line of Business Applications | Scoop.it

You want to roll out new version of viewmodel-related functions / computings / validation rules without forcing users to restart? Clients might be using multiple devices at the same time?

knockout.sync.js is a tiny ko-extension giving real-time synchronizing feature to your project.

You modify your form/values on one device and you see the changes on the client devices on the fly transparently.

Server might release new version of computed values or functions and clients can refresh the ko bindings in the background without any programming effort.

The knockout.sync.js supports to synchronize:
* values of the view model in JSON format
* the view model itself including
** static attributes
** models
** computed values
** functions
Currently it uses socket.io library to buid-up websockets as connectivity. If you need different ways, please let me know...

No comment yet.
Scoop.it!

The "Magic" behind AngularJS Dependency Injection

If you’ve built anything with AngularJS you know there’s a lot of “magic” that you can usually ignore because it just works. One of the most magical parts for me is dependency injection. Just by adding a parameter to your controller function you suddenly get access to a powerful Angular service. It’s really pretty amazing but you sorta just have to trust it … until something goes wrong.

It turns out one easy way to break an AngularJS app is to minify your javascript. This happened to me when I deployed my app to production. The Angular app was being served from a Rails application and Rails automatically minifies javascript in prodution. It turns out there’s a simple and a well documented fix in their tutorial (search for “A Note on Minification”) that boils down to “use an array of parameter names” but it wasn’t clear to me why it worked.

In the rest of this article we’re going to
* Build a simple AngularJS application
* See how magical dependency injection is
* Investigate how dependency injection is implemented in AngularJS
* Break our app by minifying the javascript
* Understand how the fix works

No comment yet.
Scoop.it!

Diving deep into the AngularUI Router

Diving deep into the AngularUI Router | JavaScript for Line of Business Applications | Scoop.it

AngularJS is packed with out-of-the-box features that we can use to build an expressive AngularJS app without relying on separate libraries; however, the very active AngularJS community has also built some great libraries that we can take advantage of to maximize the power of our apps.

This post is the first post in our mini-series where we’re covering professional components of the AngularUI library. In this post, we’ll walk through the ui-router.

The AngularUI library has been broken out into several modules so that, rather than including the entire suite, we can pick and choose the components that we’re interested in using.

 

The ui-router library is one of the most useful that the AngularUI library gives us. It’s a routing framework that allows us to organize our interface by a state machine, rather than a simple URL route.

This library provides for a lot of extra control in our views. We can created nested views, use multiple views on the same page, have multiple views that control a single view, and more. For finer grain control and more complex applications, the ui-router is a great library to understand.

No comment yet.
Scoop.it!

BinaryJS - Realtime binary streaming for the web using websockets

BinaryJS - Realtime binary streaming for the web using websockets | JavaScript for Line of Business Applications | Scoop.it

BinaryJS is a lightweight framework that utilizes websockets to send, stream, and pipe binary data bidirectionally between browser javascript and Node.js.

* BinaryPack serialization format is fast, binary, and JSON-type compatible. Data stays binary end to end
* Automatically chunks large binary data buffers for streaming performance
* Send multiple streams of data concurrently over multiplexed websocket connection
* API implements Node.js read/write Streams. You can pipe any stream into BinaryJS streams (and vice-versa)
* "pause," "resume," and "end" as in the Streams API

No comment yet.
Scoop.it!

Developing, Architecting and Testing Web Applications with MVC5, Web API 2, KnockoutJS, Ninject and NUnit

Developing, Architecting and Testing Web Applications with MVC5, Web API 2, KnockoutJS, Ninject and NUnit | JavaScript for Line of Business Applications | Scoop.it

The goal of this article is to walk through a sample Customer Maintenance web application that implements the latest technology from the Microsoft stack, including the latest beta versions of Microsoft .NET 4.5.1, Visual Studio Express 2013, MVC5, WebAPI 2 and Entity Framework 6. 

Throughout this article various design patterns and techniques will be implemented to help foster a loosely coupleddesign that promotes the Separation of Concerns (SoC) through the various layers of an n-tier web application. Overall the implementation of this sample application is a variation of my previous Code Project article MVC Techniques with jQuery, JSON, Knockout, and C#. 

No comment yet.
Scoop.it!

Hailing All Frequencies - Communicating in AngularJS with the Pub/Sub Design Pattern

Hailing All Frequencies - Communicating in AngularJS with the Pub/Sub Design Pattern | JavaScript for Line of Business Applications | Scoop.it

In this article I show you how to use the Pub/Sub Design Pattern for inter-component communications in AngularJS.

 

AngularJS has several ways that you can use to communicate between components, but the most used methods require your components to know too much about those they are communicating with, which increases the coupling between components and decreases their modularity and cohesion. This makes it hard to reuse your components in other applications.

By using the Publish/Subscribe design pattern we can decrease the coupling between components and encapsulate the details used for component communications. This will help increase your component’s modularity, testability and reuse.

No comment yet.
Scoop.it!

End to end web app in under an hour

End to end web app in under an hour | JavaScript for Line of Business Applications | Scoop.it

Here’s how to create a complete web app in under an hour. We will (naturally!) create a todo app. The features:
* Create, update, delete a todo
* Sort (and show sort order)
* Search
* Pagination

We’ll try to make it somewhat user friendly, e.g.
* Date-picker widget for todo due date
* Enable/disable buttons as appropriate for context

Our infrastructure will be:
* Backend Language: C#
* Backend Framework: WebApi
* Database: SQL Server (including SQL Express LocalDB during development)
* ORM: Entity Framework Code First + Migrations
* Frontend Framework: AngularJS
* CSS styles: Bootstrap
* IDE: Visual Studio + Resharper
* Hosting: Appharbor

As you’ll see, this particular choice of tools is well suited to rapid application development, and is also very flexible.
The goal is not just to throw together the minimal necessary to have something working, but to create a really flexible infrastructure that we can use as a foundation for many future applications. OK, let’s get started.

No comment yet.
Scoop.it!

10 Reasons Web Developers Should Learn AngularJS

10 Reasons Web Developers Should Learn AngularJS | JavaScript for Line of Business Applications | Scoop.it

There is no doubt that AngularJS – the self-proclaimed “superheroic JavaScript framework” – is gaining traction. I’ll refer to it frequently as just “Angular” in this post. I’ve had the privilege on working on an enterprise web application with a large team (almost 10 developers, soon growing to over 20) using Angular for over half of a year now. What’s even more interesting is that we started with a more traditional MVC/SPA approach using pure JavaScript andKnockoutJS before we switched over to using the power-packed combination of TypeScript and Angular. It’s important to note that we added comprehensive testing using Jasmine but overall the team agrees the combination of technologies has increased our quality and efficiency: we are seeing far fewer bugs and delivering features far more quickly.

If you are familiar with Angular, this post may give you some ideas to think about you hadn’t encountered before. If you know Angular and are trying to justify its adoption at your company or on your project, this post can provide you with some background information that may help. If you have no idea what Angular is, read on because I’ll share why it’s so powerful and then point you to resources that will get you up to speed, quickly.

I can only assume other organizations are seeing positive results after adopting Angular. According to Google Trends the popularity of AngularJS (blue) compared to KnockoutJS (red) and “Single Page Applications” (yellow) is exploding.

No comment yet.
Scoop.it!

Useful Ember Code Examples

Sharing JavaScript via JSBin, JSFiddle, etc. is great but it can be hard to keep track of them. Here is a list of useful Ember code examples.

* helpers

* components

* d3

* views

* routes

* controllers

* tips

No comment yet.
Scoop.it!

Async-IO.org: Powering the Atmosphere Framework

Async-IO.org: Powering the Atmosphere Framework | JavaScript for Line of Business Applications | Scoop.it

Async-IO.org is the company behind the Atmosphere Framework! The Atmosphere Framework is the most popular asynchronous application development framework for enterprise Java. The Atmosphere Framework provides the enterprise features required to build massive scalable and real time asynchronous applications using transport like WebSocket, Server Side Events and traditional Ajax Techniques.

* It's been proven in production: Reverb, Wall Street Journal, GameDuell, VMWare, Atlassian and many more
* Easy to write portable and asynchronous applications with a really simple API for both client and server
* Supports WebSockets and fallback transports transparently
* Proven to scale
* Cloud Enabled!

No comment yet.
Scoop.it!

Simple Signup and Login with Firebase and Knockoutjs

Simple Signup and Login with Firebase and Knockoutjs | JavaScript for Line of Business Applications | Scoop.it

In this tutorial you will learn how to set up an effective registration and authentication process for your web app using Firebase, knockoutjs and Twitter Bootstrap.... and..... that's it. No backend mysql database, apache web server, ubuntu linux or ruby scripting is required. You just need to know javascript. You don't even need to know nodejs, npm or requirejs. There really is no back end and it is simple to build.

Knockout uses a MVVM (Model-View-ViewModel) pattern. We are starting with the view which is the body of the index.html file. This is quite straight forward. Twitter Bootstrap is called in through the class attribute of our input and div tags to make our page look nice. Knockout is called in through the data-bind attribute of our input tags and buttons. When the user keys in her user name and password, we want this data to go into application memory (the Model of MVC) and then on to the Firebase servers. Our View gives is the basic entry points that are required.

The View Model is the magic wiring between the View and application memory. We need to wire 3 things to start with ...

No comment yet.
Scoop.it!

Setting up an Ember App with a Rails Backend

Setting up an Ember App with a Rails Backend | JavaScript for Line of Business Applications | Scoop.it

Today I’m going to show you how to setup an Ember app with a Rails backend. The process is relatively straightforward, but there are some gotchas that I’d like to help you avoid.

The app will use Haml, CoffeeScript, Emblem, and Ember Data. In this tutorial I’ll be starting a sample app called Launch Bay. Launch Bay would essentially be an ultra-lightweight version of Pivotal Tracker. In this first post I’m just going to get my app setup to receive data.

No comment yet.
Scoop.it!

Meteor hacks and tricks

Meteor hacks and tricks | JavaScript for Line of Business Applications | Scoop.it

Viable collection of blog posts about Meteor.js

Code Samples, Extensions to the core and Best Practices.

No comment yet.
Scoop.it!

How To Unit Test An Angular App.

How To Unit Test An Angular App. | JavaScript for Line of Business Applications | Scoop.it

AngularJS has a great testing story - it’s all based on Dependency Injection, the Karma test runner was written by one of its core developers Vojta Jina and it ships with a variety of mocks like the $httpBackend for unit testing requests to remote services.

What I haven’t been able to find much of are examples showing how to take advantage of these features when testing an application that does more than just expose objects connected via a rest api.

Today we’re going to build a simple Tic-Tac-Toe game writing unit tests along the way.

No comment yet.
Scoop.it!

AngularJS - Perceived Performance Directive

AngularJS - Perceived Performance Directive | JavaScript for Line of Business Applications | Scoop.it

In a traditional page, measuring the page performance is quite easy; a request is made, the server responds with some HTML and the browser renders it. Done.

A lot of the rendering logic is taken care of as part of the server processing and so looking at Window Load and DOMContentReady are good indicators of page performance.

In a Single Page Application, things get trickier. The Window Load is only the beginning - that's when the JavaScript has been delivered to the browser, at which point the client-side logic - all the real work - kicks in and begins rendering the page, making API calls and setting up listeners, events, etc.

The DOM is then continuously manipulated as part of user interaction or monitoring, polling and other events. As you can see, the traditional definition of a page being 'done' doesn't apply here.

The perceived page performance is how long the user thinks the major elements of the page took to load. By definition it is highly subjective - some users may think that the page is loaded just because the initial furniture appears. But for most users this will be the parts of the page they consider most important.

No comment yet.
Scoop.it!

Why Angular, Ember, or Backbone don't work for us

Why Angular, Ember, or Backbone don't work for us | JavaScript for Line of Business Applications | Scoop.it

Moot is a special discussion platform with ambitious goals. While the server side is fanatically optimized for performance, the client has its own goals: simple API, small size, and quick release cycle. The code is written from scratch and is split into more than 50 files. A client side framework such as Angular or Ember were out of the question.

Here's why.

* API first
* Small size
* Full control
* Special needs
* Technology lock-in
* Why not Angular?
* Why not Ember.js?
* Why not Backbone.js?
* But jQuery leads to spaghetti, right?
* The results

No comment yet.