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

Ember Components: Building blocks for ambitious web applications.

Ember Components: Building blocks for ambitious web applications. | JavaScript for Line of Business Applications | Scoop.it

Where would I prefer to use a view over a component?

This depends clearly on your use case. But as a rule of thumb, if you need in your view directly access to it's surrounding context like the controller nor route use a Ember.View, but if you want to isolate the view and pass in only the information that it needs to work making it agnostically of the context and much more reusable, use a Ember.Component.

As already mentioned Ember.Component extends from Ember.View and therefore inherits all of Ember.View attributes and capabilities. But it's the differences to an Ember.View which makes an Ember.Component unique of it's kind.

No comment yet.
Scoop.it!

From Rails to AngularJS

Unfortunately, building a prototype is always the easy part. Doing the whole port has had a bunch of problems I did not take forsee. I put in a proposal outlining the goals and how to reach those goals on December 4'th, 2013. As of writing this, it's February 1'st, 2014, and we have still not managed to remove all of our Rails views.

Thankfully, we made this a progressive transition, which meant we could roll out changes progressively. The basic idea is that we'd convert one page at a time, and push it out to our customers. We weren't exactly perfect on this, and ended up taking a few weeks before we rolled anything out, but as of right now, we're at the point where we can move pages from Rails to AngularJS very easily.

The ultimate goal is to get Rails to just handle our API, and the angular app can handle the console experience; it also means removing all of our assets from Rails.

I'm going to share how our development workflow looks, some of the issues we encountered, and how we solved them.

No comment yet.
Scoop.it!

Create a Laravel and Angular Single Page Comment Application

Create a Laravel and Angular Single Page Comment Application | JavaScript for Line of Business Applications | Scoop.it

Laravel and Angular have both become very well renowned tools in the web development world lately. Laravel for the great things it brings to the PHP community and Angular for the amazing frontend tools and its simplicity. Combining these two great frameworks only seems like the logical next step.
For our use cases, we will be using Laravel as the RESTful API backend and Angular as the frontend to create a very simple single page comment application.
This will be a simple example to show off how to get started using these two technologies so don’t hope for any extra database stuff on how to handle sub-comments or anything like that.

This will be a simple single page comment application:
* RESTful Laravel API to handle getting, creating, and deleting comments
* Angular frontend to handle showing our creation form and the comments
* Ability to create a comment and see it added to our list w/o page refresh
* Ability to delete a comment and see it removed from our list w/o page refresh

Overall, these are very simple concepts. Our focus will be to see the intricacies of how Laravel and Angular can work together.

No comment yet.
Scoop.it!

Undocumented secrets of $scope.$watch

Undocumented secrets of $scope.$watch | JavaScript for Line of Business Applications | Scoop.it
A look at the angular source code reveals some nifty tricks that border on Functional Reactive Programming.

Most angular devs I’ve talked to use $scope.$watch sparingly and as advertised: for DOM manipulation inside directives.

For the unfamiliar, each time $scope.prop changes, our callback gets invoked and updates the DOM. This is, in fact, the same API that angular uses to implement one direction of its two-way data binding.

at most devs don’t know is that $scope.$watch takes an expression, not just a property name.

No comment yet.
Scoop.it!

Demystifying AngularJS' dependency injection

Many people think that it is some kind of magic, how AngularJS resolves dependencies given as function arguments. But it isn't any magic. I'll show you, how they achieve it. This technique can be used everywhere, not just with AngularJS.

If you don't know what does dependency injection look like with AngularJS, here is an example...

It's fairly easy in JavaScript to get the source code of the every function. We just have to call the.toString() method of the function objects. Here we go. We just have to find a way to extract the argument list of our function...

No comment yet.
Scoop.it!

AngularJS -- Quick Role-Based Authentication

AngularJS -- Quick Role-Based Authentication | JavaScript for Line of Business Applications | Scoop.it

We've recently started on a new product at work using the AngularJS framework. One of the most useful resources when starting out was the #angularjs room on freenode. There seems to be a really large, vibrant community around AngularJS and that's always helpful when starting from scratch on a new framework. One of the best resources in the room was David Mosher, who helped us get set up with Lineman -- an awesome build framework based on Grunt -- and pointed us to some of his video tutorials. Honestly, these were a great resource for getting started and I highly recommend watching them. The following tutorial is heavily inspired by the examples David provided.

I have had quite a few requests for a working code sample for this post. I spent some time putting one together and you can find it here. Note that the working code is slightly different than the code above, but the main idea is the same.

Jan Hesse's insight:

https://github.com/artgon/angularjs-role-based-auth

No comment yet.
Scoop.it!

MVC4-Boilerplate with Bootstrap for vb.net

MVC4-Boilerplate with Bootstrap for vb.net | JavaScript for Line of Business Applications | Scoop.it
MVC4-Boilerplate - A boiler plate for MVC4 vb.net web applications

* Modernizr
* HTML5 Boilerplate
* Bootstrap
* Font Awesome

No comment yet.
Scoop.it!

Getting started with Ember.js and Ruby on Rails: Ember Appkit Rails

Getting an Ember project started is really easy thanks to EAK, it already puts the basic structure of our apps so we can focus on what we like the most, developing.
But what if I want to use Ruby on Rails and Ember? How can I get all this stuff to play nicely?.
There are three options:

1. Keep two separate projects, a Rails app (probably using rails-api) and an EAK app.
2. Use the ember-rails which basically puts Ember’s source files in your project and compiles your templates.
3. Use Ember Appkit Rails :).

No comment yet.
Scoop.it!

Onsen UI: The Answer to PhoneGap UI Development

Onsen UI: The Answer to PhoneGap UI Development | JavaScript for Line of Business Applications | Scoop.it

Onsen UI is a Custom Elements-Based HTML5 UI Framework for Building Your Mobile Front End.

Onsen UI is a front-end development tool that radically improves PhoneGap/Cordova apps. Differing from previous frameworks, it is highly flexible and gives hybrid apps a native look and feel on all platforms. And when used with Monaca, it is simple to add backend features and device support, resulting in a publishable app.

A powerful feature of Onsen UI is its customizability. In addition to the themes provided, you can develop your own themes. Each component in a theme can also be customized, by modifying the HTML and CSS code. See Customize page which go into details.

No comment yet.
Scoop.it!

Javascript Puzzlers or: do you really know JavaScript?

Javascript Puzzlers or: do you really know JavaScript? | JavaScript for Line of Business Applications | Scoop.it

How insane do you think JavaScript actually is?

A questionary al la wtfjs.

No comment yet.
Scoop.it!

vue.js - Intuitive, Fast and Composable MVVM for building interactive interfaces.

vue.js - Intuitive, Fast and Composable MVVM for building interactive interfaces. | JavaScript for Line of Business Applications | Scoop.it

Vue.js is a library for building interactive web interfaces. 

It provides efficient MVVM data bindings with a simple and flexible API.


Technically, Vue.js is focused on the ViewModel layer of the MVVM pattern. It connects the View and theModel via two way data bindings. Actual DOM manipulations and output formatting are abstracted away into Directives and Filters.

Philosophically, the goal is to provide the benefits of MVVM data binding with an API that is as simple as possible. Modularity and composability are also important design considerations. It is not a full-blown framework - it is designed to be simple and flexible. You can use it alone for rapid prototyping, or mix and match with other libraries for a custom front-end stack. It’s also a natural fit for no-backend services such as Firebase.

Vue.js’ API is heavily influenced by AngularJS, KnockoutJS, Ractive.js and Rivets.js. Despite the similarities, I believe Vue.js offers a valuable alternative to these existing libraries by finding a sweetspot between simplicity and functionality.


No comment yet.
Scoop.it!

Reasons to Adopt AngularJS to master Web Application Development

New to AngularJS?, having doubts on its implementation and usage…??  Wondering why to switch from traditional MVC/SPA approach using pure JavaScript and KnockoutJS to the power pack combination of TypeScript and Angular ? Well then here’s everything you need to understand and get started with AngularJS .

Angular has some compelling features for not just the developers but for designers as well...

No comment yet.
Scoop.it!

Lighttest, a clear testing environment

Lighttest is a JavaScript unit-testing library — it works both in browsers and under Node.js, supports flow control, and is focused on keeping the tests clear. This is achieved with a minimal syntax of the test cases, and the only testing function, lighttest.check(), used to indicate a success or a failure. As shown below, any testing behaviour could be implemented using that function and the native means of JavaScript. As result, one can easily understand or prepare the exact process performed by a test without a need to involve some additional testing API.

No comment yet.
Scoop.it!

Creating a real-time multiplayer game with WebSockets and Node.js

Creating a real-time multiplayer game with WebSockets and Node.js | JavaScript for Line of Business Applications | Scoop.it

During the workshop I explained exactly how to take a single player HTML5 game and turn it into a multiplayer one using Node.js and WebSockets.


Each player is identified using a unique client.id number. We'll use this later when communicating game updates to other players. For now the util.log line will output the client identification number to the terminal on connection.

The client.on event listeners are used to detect when a player has either disconnected or sent a message to the server. Right now they point to handler functions that don't exist.


No comment yet.
Scoop.it!

BDD in JavaScript III: CucumberJS and Test Automation

BDD in JavaScript III: CucumberJS and Test Automation | JavaScript for Line of Business Applications | Scoop.it

The benefit of automation is in time saved. If we can pinpoint tasks that we do repetitively during development and automate them, we can save large amounts of time that could be put back into doing more coding, thinking, learning, laughing, beering - the list goes on.

While going through the basics of CucumberJS in the previous articles, I was demonstrating how I use the tool to TDD from the outside-in and constantly hopping back and forth from my code editor to the terminal to run this simple command over and over:

Now, I am pretty good at CMD+TAB - not to brag - but I would much prefer to get feedback on my tests instantly as I describe my asserts and modify my code. If we automate the running of Cucumber on file change, we can start seeing results quicker and we can take that time removed from manually switching between editor and terminal and running commands and put that time back into thinking how to design our code more cleanly :)

This automation and instant feedback really shows its worth in the Refactor phase in which you have previously implemented code to pass the criteria in a Feature.

No comment yet.
Scoop.it!

Using Ember.js with Spree

Using Ember.js with Spree | JavaScript for Line of Business Applications | Scoop.it

For some time we’ve been wondering what would it be like to integrate Ember.js with a Spree Ecommerce application. In this post we’ll see how to create a simple Ember.js application that serves data from a Spree API endpoint.

In this post we’ll take a look at:
* choosing the right development tools for your app
* how to setup your Spree application to serve an Ember application
* a quick way to authenticate a Spree user to use the Ember application
* understanding the differences between Spree’s and Ember Data’s APIs
* coding a basic Ember application to show products

You can follow what’s happening in the blogbpost by playing around with the fully working example: spree-ember-example. It’s built with Spree 2.1 but both 2.0 and 1.3 should work flawlessly.

WARNING: this post is quite long as we’ll have to cover code for each of the steps needed. If you don’t like long posts, refer to the demo application linked above to get a full picture faster.

No comment yet.
Scoop.it!

Engineering in JavaScript for SAPUI5

Engineering in JavaScript for SAPUI5 | JavaScript for Line of Business Applications | Scoop.it

Having talked to many developers, we found out that there is a huge demand for topics around engineering of SAPUI5 applications. The dynamic nature of JavaScript makes the language very powerful, but it is also challenging to build maintainable products with huge codebases. To counteract the tendency to messy codebases, we have to establish conventions and apply good engineering techniques. This blog post shall act as an overview about the different topics like testability, test driven development, local testing, continuous integration, agile software engineering, tools, setup of development environments, and clean code.


Setup of Development Environment:
* Setup for Local Testing in Eclipse

Testability:
* Starting with Test Driven Development in JavaScript
* Getting more out of your JavaScript unit tests with strict mode
* Basic Patterns for Testable JavaScript Code
* How to Unit Test Custom Exceptions with QUnit
* Unit versus Integration-Tests in JavaScript
* Isolated Integration Tests
* How to improve the testability of a SAPUI5 app
* How to test against SAPUI5 views in a non-fragile way
* How to replace an ODataModel by a JSON Model

Tools:
* TDD and JavaScript - JavaScript Unit Tests for UI5 Applications

No comment yet.
Scoop.it!

Mastering the Module Pattern

Mastering the Module Pattern | JavaScript for Line of Business Applications | Scoop.it

I'm a massive fan of JavaScript's Module Pattern and I'd like to share some use cases and differences in the pattern, and why they're important. The Module Pattern is what we'd call a "design pattern", and it's extremely useful for a vast amount of reasons. My main attraction to the Module Pattern (and it's variant, the Revealing Module Pattern) are because it makes scoping a breeze, and doesn't overcomplicate JavaScript design.

It also keeps things very simple and easy to read and use, uses Objects in a very nice way, and doesn't bloat your code with repetitive this and prototype declarations. I thought I'd share some insight as to the awesome parts of the Module, and how you can master it and it's variants and features.

No comment yet.
Scoop.it!

Creating a Basic Re-usable Component in Knockout 3.0

Creating a Basic Re-usable Component in Knockout 3.0 | JavaScript for Line of Business Applications | Scoop.it
Learn how to create a re-usable component in your next project using Knockout.js.

Often when building more complex applications, instead of repeating the same template and binding logic, you’ll want to isolate it as a unit of UI functionality and re-use it throughout your application. When starting out with Knockout.js, however, it’s not always obvious how to do this. In this post I’ll run through creating a pagination control as an example of how to create re-usable controls in Knockout.

No comment yet.
Scoop.it!

INIT • An initial boilerplate for front-end projects

INIT • An initial boilerplate for front-end projects | JavaScript for Line of Business Applications | Scoop.it

Init is an initial boilerplate for front-end projects which adds more complexity to your application.

INIT is based upon HTML5 Boilerplate and adds more structure for SCSS and JavaScript files, includes build tasks and a whole lot more.

Integrated tools:
* HTML5 Boilerplate
* normalize.css
* Modernizr (custom build based on what you use) & jQuery libraries
* GruntJS (integrated watch, development & build tasks)
* Bower for package management in th Front-End
* RequireJS for a module-based development approach
* Sass workflow including some helpful mixins
* A testing workflow with Jasmine and Karma


No comment yet.
Scoop.it!

Elegant token-based API access with AngularJS

Learn how to handle token-based API access with AngularJS in an elegant, Don’t Repeat Yourself manner by globally transforming requests and handling failure and token re-issue using response interceptors.

In a single page web app, the entire application payload is downloaded to the user’s browser, so you can’t bundle credentials as part of the app’s environment - that environment is the user’s browser potentially on millions of machines you have no control over.

A solution is to ask the user to sign in (i.e. they supply their own credentials) and the server returns a token. From hereon in the token can be sent with any API requests and all the server needs to do is to verify the token on each request. In an Angular service, using the built-in $http service, retrieving some data might look like...


No comment yet.
Scoop.it!

JSONsvc - a "proxy-peer/peer" protocol for Websockets

JSONsvc defines a simple format for data to be sent between a Websocket server and its clients. It allows browser clients to view the connection as a type of "proxy-peer-to-peer" network. i.e. any client can send data to another client as if they were directly connected - the websocket server does the routing.

The protocol also allows multiple clients to automagically receive data they are interested in whenever anyone else sends it - again routed by the websocket server.

The intended interest here is in the use of general-purpose protocol with a server, rather than some ad-hoc scheme which means you would have to change client and server code to add or change any functionality.  

No comment yet.
Scoop.it!

Working with quota on mobile browsers: A research report on browser storage

Working with quota on mobile browsers: A research report on browser storage | JavaScript for Line of Business Applications | Scoop.it
An in-depth article about the state of client-side storage on mobile devices.

As web apps get richer and richer, more and more developers are using browser-side storage. However, there hasn't been a major study comparing the limitations of the various storage mechanisms. It is time consuming for developers to research each method and browser. So in this article, I'm going to show you the results of my research on the upper limit of each browser's storage implementation, as well as how you can inspect them.

No comment yet.
Scoop.it!

Reactive Joins In Meteor

Reactive Joins In Meteor | JavaScript for Line of Business Applications | Scoop.it

One of the benefits of building Meteor applications is that you don’t have to think about client-server APIs anymore, since Meteor’s built-in collections handle synchronizing data to the browser for you.

But this new paradigm comes with its own requirements: order to limit the amount of data and maintain privacy, any real-world app must also include a set of publications and subscriptions in order to make sure the right data is transmitted to the right users.

Consequently, publication design is a very important part of building a large scale Meteor app, and it’s often a new challenge for even the most experienced of web developers. So today, we’ll take a look at one of the trickiest problems of publishing data with Meteor: joining across collections.

No comment yet.
Scoop.it!

How to Unit Test Custom Exceptions with QUnit

How to Unit Test Custom Exceptions with QUnit | JavaScript for Line of Business Applications | Scoop.it

When writing robust JavaScript code, you will probably want to throw exceptions to let programmers know when they’ve misused your API. Sure, you could throw an instance of the built-in Error object, but then during unit testing how will you tell if the exception you’re seeing is yours and not coming from somewhere else?

 

The solution is to use a custom exception in your method, but this opens up a whole new can of worms. JavaScript’s weak typing and poor support for sub-classing Error mean that a custom exception class can easily be created with no error message, or even worse with no stack trace!

 

Today, I’m going to help you solve both these problems, and introduce you to a neat, undocumented feature in QUnit that will help you unit test your methods.

No comment yet.