JavaScript for Line of Business Applications
596.1K views | +0 today
Follow
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

Current selected tag: 'directive'. Clear
Scoop.it!

Communication between Angular Controller and Directive

Communication between Angular Controller and Directive | JavaScript for Line of Business Applications | Scoop.it

Implementing bidirectional communication between angular controllers and directives using isolated scopes.

Since I had issues finding a good explanation on how to tie together a controller and a directive with isolated scope I decided to create my own blog post on this subject. This repo contains a runnable example of the solution. It contains a Spring Boot Web Application that can be started to act as a HTTP server but all the interesting stuff is in the src/main/webapp folder.

No comment yet.
Scoop.it!

LumX - The first responsive front-end framework based on AngularJS & Google Material Design specifications.

LumX - The first responsive front-end framework based on AngularJS & Google Material Design specifications. | JavaScript for Line of Business Applications | Scoop.it

LumX will help you to design beautiful applications, faster and easier. We’ve built it based on google guidelines, respecting metrics in a pixel perfect way.

It provides a full CSS Framework built with Sass and a bunch of AngularJS components.

No comment yet.
Scoop.it!

AngularJS, the Digest Loop, Directives and jQuery

AngularJS, the Digest Loop, Directives and jQuery | JavaScript for Line of Business Applications | Scoop.it

I’ve been struggling with understanding when and how to use jQuery inside an AngularJS directive and have the data binding work as expected.  I’ve got a good example I put together that shows how to do this as well as shows when you need to use the scope.$apply(). 

You can see from the below example that in the directive, I am using AngularJS.  Because our DOM is being modified outside of what AngularJS can see, it does not have a watch assigned to it and therefore in the AngularJS digest loop, the scope.cntjQuery does not get updated.  As we know, the $scope contains the “truth” of this application but if the digest loop is not run then the truth never makes it to the browser.  Calling scope.$apply() causes the digest loop to be run.

No comment yet.
Scoop.it!

Extending HTML with AngularJS's Directives

Extending HTML with AngularJS's Directives | JavaScript for Line of Business Applications | Scoop.it
The main thing about AngularJS is that it allows us to extend the capabilities of HTML to serve the purpose of today's dynamic webpages. In this article I will show you how you can use AngularJS's Directives to make your development faster, easier and your code more maintainable. | Difficulty: Intermediate; Length: Medium; Tags: AngularJS, JavaScript
No comment yet.
Scoop.it!

ngReactGrid - A really fast Angular grid using the power of React

ngReactGrid - A really fast Angular grid using the power of React | JavaScript for Line of Business Applications | Scoop.it

ngReactGrid is an Angular directive that can be used to render an enhanced HTML table or grid of data very fast using React as the rendering engine. It is based on ng-grid and jQuery DataTables. It uses HTML tables and supports fixed column headers by default.

Jan Hesse's insight:

http://www.josebalius.com/why-i-stopped-using-ng-grid-and-rolled-my-own-with-reactjs/

No comment yet.
Scoop.it!

Leaflet directive for AngularJS

Leaflet directive for AngularJS | JavaScript for Line of Business Applications | Scoop.it

This directive allows you to embed a map on your AngularJS application and interact bi-directionally with it via the AngularJS scope and the leaflet map library API. In its current state, it's not a full-featured library, although it's easy to use and extend, and a good starting point to learn to code a directive into the great AngularJS library.

Hector R Salazar's curator insight, August 26, 2014 8:39 AM

Ionic + Angular + Leaflet

Scoop.it!

Collection of AngularJS Directives

Collection of AngularJS Directives | JavaScript for Line of Business Applications | Scoop.it

A growing list of handy Directives.


Categories:

* $http
* bootstrap
* charts
* drag-n-drop
* filter
* form
* image
* layout
* map
* mobile
* scroll
* sort
* table
* touch
* upload

No comment yet.
Scoop.it!

ion-search directive with Ionic framework

ion-search directive with Ionic framework | JavaScript for Line of Business Applications | Scoop.it

A demo of a directive which add a fancy search bar to filter data. It can filter / search from promises sources and preloaded sources. For the promises demo, I used Web SQL, so it's Chrome/Safari only compatible (but 100% compatible with the SQLite Cordova plugin :D)

No comment yet.
Scoop.it!

Posting Data & AngularJS Custom Directives in an ASP.NET MVC application

Posting Data & AngularJS Custom Directives in an ASP.NET MVC application | JavaScript for Line of Business Applications | Scoop.it

In this article, we will explore how to use AngularJS to Post Data and use AngularJS Custom Directives in an ASP.NET MVC application.

So to post data, we need to simply call the save function on our resource instance. However there is a slight gotcha. The $resource object expects all the functions to post to the same URL. In MVC terms, this means posting to the same action method with different HttpGet/HttpPost/HttpPut etc attributes.

In our code, currently the HomeController uses GetTweets method to get the Data. Now Posting to a URL called GetTweets is semantically icky. So let’s update the Controller method to be called justTweetSo we will do GET, POST, PUT etc. requests to the url /Home/Tweet.

No comment yet.
Scoop.it!

AngularJS Custom Directives

AngularJS Custom Directives | JavaScript for Line of Business Applications | Scoop.it

AngularJS directives are what controls the rendering of the HTML inside an AngularJS application. Examples of directives are the interpolation directive ( {{ }} ), the ng-repeat directive and ng-if directive.
It is possible to implement your own directives too. This is what AngularJS refers to as "teaching HTML new tricks".

You can implement the following types of directives:
* Element directives
* Attribute directives
* CSS class directives
* Comment directives

Of these, AngularJS recommends that you try to use element and attribute directives, and leave the CSS class and comment directives (unless absolutely necessary).
The type of a directive determines how the directive is activated. An element directive is activated when AngularJS finds a matching HTML element in the HTML template. An attribute directive is activated when AngularJS finds a matching HTML element attribute. A CSS class directive is activated when AngularJS finds a matching CSS Class. And, a comment directive is activated when AngularJS finds a matching HTML comment.

No comment yet.
Scoop.it!

ngDialog.js - Modals and popups provider for Angular.js applications

Modal dialogs and popups provider for Angular.js applications.

ngDialog is small (~2Kb), has minimalistic API, highly customizable through themes and has only Angular.js as dependency.

ngDialog service provides easy to use and minimalistic API, but in the same time it's powerful enough. 

No comment yet.
Scoop.it!

NgReact.js - React Components in Angular

Facebook's React library is designed to be used as a view component atop other JavaScript frameworks. NgReact is a pair of proof of concept directives that show how React can cooperate with Angular, resulting in performance gains nearly up to 70% (or, well, losses up to 450%).

No comment yet.
Scoop.it!

Unit testing an AngularJS directive

Unit testing an AngularJS directive | JavaScript for Line of Business Applications | Scoop.it

In this article, i’ll detail the process to unit test the stepper directive we’ve created in the last week custom component creation article. Next week, i’ll cover how to distribute your component via GitHub and Bower.

Unit testing is the art of testing individually every smallest part of your code, which are the foundations of your apps sanity. Once correctly tested, these parts assembled together will also play nicely, as their behaviour has already been validated independently.

Unit testing helps you prevent regressions, increase quality, maintenability, and trust in your codebase, thus better team collaboration, easier refactoring… and WIN :)

Another usage is, when you get a new bug report, you add the revelant test that demo the bug, fix it in your code so the test will pass, then keep it there as a proof of reliability.

No comment yet.
Scoop.it!

Containers and Components in Angular 1

Containers and Components in Angular 1 | JavaScript for Line of Business Applications | Scoop.it

In this post, I want to explore a different approach to writing directives in Angular 1. As we know, building applications in Angular 2 is going to be different from what we’re used to in Angular 1. For example,ng-controller will be gone, and components will be the building blocks of applications.

What exactly is a component? It is essentially a thing that encapsulates an internal state and manages external interactions. The interactions could be with the user or with other components.

Since I’ve been working heavily with React recently, I want to see how we can borrow some ideas from there and apply them to Angular 1 directives.

In particular, I want to explore the idea of Containers and Components in Angular 1.

No comment yet.
Scoop.it!

Breaking Down AngularJS to Smaller Components

Breaking Down AngularJS to Smaller Components | JavaScript for Line of Business Applications | Scoop.it

Separation of concerns has its own tradeoffs. A lot of people doesn’t seem to understand this; they tend to use Controller for everything. Even library authors instruct that way. Although library authors are not to be blamed, it seemed to have been applied in practice by everybody, and that’s not awesome.

No comment yet.
Scoop.it!

Shake that login form with AngularJS

Shake that login form with AngularJS | JavaScript for Line of Business Applications | Scoop.it

I've created a custom directive shakeThat which has two scope variables. The first one submit calls the parent controller function submit() when the form is valid. The second one submitted is a Boolean value and false at the beginning. It simply defers the activation of error classes until the user clicks on the 'Login' button. Check out AngularJS Form Validation for more information about the submitted variable.

No comment yet.
Scoop.it!

AngularJS and jQuery Dialogs

I’m using jQuery dialogs in an AngularJS application. I’ve struggled to find a way to use them that follows angular ‘best practices’.


Then I thought, what if I created a generic directive that would allow me to set the dialog options in the markup? Furthermore, what if I could register the the dialog in a service so I could inject it into a controller and open the dialog using that controller? It turns out it’s possible with a little angular black magic. Meet the jqdialog directive.

No comment yet.
Scoop.it!

Why I stopped using ng-grid and rolled my own with ReactJS

Why I stopped using ng-grid and rolled my own with ReactJS | JavaScript for Line of Business Applications | Scoop.it

I get that ng-grid is based off SlickGrid and uses virtualization to not render the full data set, but I am not sure this works well with Angular and the performance issues you run into when you have 2000+ bindings on the page.

I knew I could not be happy with this project until I fixed this problem. I tried a lot things with ng-grid, using bindonce, and other suggestions but the performance gain would usually create a bug in one of the grids where I was expecting the bindings to work as usual.

At the time, I thought to myself that I should switch to ng-table. But I had written so much code already that the ng-table seemed too expensive.

That's when I decided to create a proof of concept with one of the bigger grids and render it with ReactJS.

I created an AngularJS directive called reactGrid, and tried to support ng-grid's api as much as possible (with some minor changes).

Jan Hesse's insight:

http://josebalius.github.io/ngReactGrid/

No comment yet.
Scoop.it!

n3-charts: Versatile charts for AngularJS

n3-charts: Versatile charts for AngularJS | JavaScript for Line of Business Applications | Scoop.it

Built on top of D3.js and AngularJS, n3-charts.line-chart directive creates beautiful charts in AngularJS applications. It is simple and interactive.

Jan Hesse's insight:

https://github.com/n3-charts/line-chart

No comment yet.
Scoop.it!

5 useful AngularJS directives, modules and services

5 useful AngularJS directives, modules and services | JavaScript for Line of Business Applications | Scoop.it

* ng-flow

* RESTAngular

* ng-table

* ui-router

* ng-csv

No comment yet.
Scoop.it!

Hacking Core Directives in AngularJS

Because Angular is totally modular, you can easily replace any of its parts. Lets look at ngSrc for a case where this technique is useful...

We want to parse a list of Angular expressions from the value of ngSrc and only set src if all of them are defined.
We can use decorators to make ngSrc have this behavior.


No comment yet.
Scoop.it!

Angle Brackets, Synergistic Directives

Angle Brackets, Synergistic Directives | JavaScript for Line of Business Applications | Scoop.it

Just as promised, this article will cover isolate scopes, transclusion, linking functions, compilers, directive controllers, and more.

Synergy makes Angular applications work as if magic existed. Synergy makes complex interaction feel easy, reasonable, and understandable. Synergy is what drives complex interaction into its building blocks, breaking it down into the essentials, which anyone can understand. Synergy is everywhere, synergy isn't just in code itself, but you can find it in UX, too. A synergistic application will feel more natural, easier to use, and more intuitive. You'll feel like you know the application, and often guess correctly what the next step will look like, because the application author cared about what you'd think should happen.
In Angular, synergy means being able to build componentized directives, services, and controllers, which can be reused as often as it makes sense for them to be reused. For instance, you might have a simple directive which turns on a class based on a watched scope expression, and I'd imagine that could be a pretty common directive, used everywhere in your application, to signal the state of a particular component in your code. You could have a service to aggregate keyboard shortcut handling, and have controllers, directives, and other services, register shortcuts with that service, rooting all of your keyboard shortcut handling in one nicely self-contained service.
Directives are also reusable pieces of functionality, but most often, these are associated to DOM fragments, or templates, rather than merely providing functionality. Markup is equally important in providing synergy, if not even more so. Time for me to give you a deep down dive of Angular directives and their use cases.

No comment yet.
Scoop.it!

A Practical Guide to AngularJS Directives

A Practical Guide to AngularJS Directives | JavaScript for Line of Business Applications | Scoop.it

Directives are the most important components of any AngularJS application. Although AngularJS ships with wide range of directives, you will often need to create application specific directives. This tutorial will give an overview of custom directives and explain how to use them in real world Angular projects. At the end of the tutorial, I will guide you through the creation of a simple note taking app with the help of Angular directives.

Jan Hesse's insight:

follow up:

http://www.sitepoint.com/practical-guide-angularjs-directives-part-two/

No comment yet.
Scoop.it!

angular-ui-foundation: AngularJS Directives for Foundation

angular-ui-foundation: AngularJS Directives for Foundation | JavaScript for Line of Business Applications | Scoop.it

Provides directives specific for using Foundation with AngularJS. 

No comment yet.
Scoop.it!

Testing AngularJS directive templates with Jasmine and Karma

Testing AngularJS directive templates with Jasmine and Karma | JavaScript for Line of Business Applications | Scoop.it

In my day job, I work on appear.in, a video chat service built with AngularJS and WebRTC. Recently, our application has become more complex, and our HTML templates ended up having a lot of state in them. We could no longer just use unit testing to verify our application logic, we also needed to test the state in our templates.

For our unit testing, we landed on using Jasmine and Karma, and this has worked fairly well for us. So when we wanted to test our templates, we wanted to use the same tools.

No comment yet.