
Fuse.js | K. Risk - JavaScript Refined Lightweight fuzzy-search, in JavaScript. Download: fuse.js - (9 kb) development fuse.min.js - (1.58 kb) production Why? If you need a lightweight, fast way to search through a list of items, and allow mispellings, then Fuse.js is for you. Try it out! Given this list of books, try searching by misspelling the title or author’s name: The results are sorted by score. Usage Suppose you have the following data structure: Example 1 Search and return a result list of identifiers Example 2 Search and return a result list of records Example 3 Search over a flat array, and return the indices Options keys List of keys (properties) that will be searched. Limitations This isn’t meant to work across hundreds of thousands, or millions of records. Note: the pattern string cannot exceed 32 characters. How does it do it? Currently, it uses a full Bitap algorithm, leveraging a modified version of the Diff, Match & Patch tool by Google. To do Currently planning to make it faster, and work for larger sets of data. Problems?
Code Organization in Large AngularJS and JavaScript Applications — Cliff Meyers Many developers struggle with how to organize an application's code base once it grows in size. I've seen this recently in AngularJS and JavaScript applications but historically it's been a problem across all technologies including many Java and Flex apps I've worked on in the past. The general trend is an obsession with organizing things by type. Let's take a look at angular-seed, the official starting point for AngularJS apps. css/img/js/ app.jscontrollers.jsdirectives.jsfilters.jsservices.jslib/partials/ The JavaScript directory has one file for every type of object we write. This is a mess. The next logical pass at organizing JavaScript involves creating a directory for some of the archetypes and splitting objects into their own files. Let's imagine we're building a simple e-commerce site with a login flow, product catalog and shopping cart UI's. Nice! Imagine you're at the office and realize you need a few outfits dry-cleaned for a business trip tomorrow morning.
Jehu/ng-mobile egghead.io: Learn AngularJS with Tutorial Videos & Training @eggheadio Jens Rantil's Hideout Lately I've been working a lot in AngularJS. This is my second project with the framework, and the more time I spend in it, the more I like it. But as with most things, AngularJS has some rough corners. Its documentation still has a long way to go, although it has improved since last time I used it over a year ago. My intention with this blog post is to go through one such use case, namely dealing with complex dependencies. The level of this tutorial is intermediate. A slow service Let's say you have some data you would like to present to your user and you prepare some data in your controller. This is very basic AngularJS and I expect you to have no problems understanding the mapping done here. But in the real world, we rarely hardcode things. Now, let's create a service that simulates a slower API call. Notice that it takes a couple of seconds before the result is presented on the screen when you click "Result". Obviously, we are not generating any errors here, but you never know!
AngularJS Tutorial: Learn to Rapidly Build Real-time Web Apps with Firebase In response to the feedback from our original tutorial, we decided to take the new version of the tutorial in an entirely new direction. Mucking around in backend code doesn't belong in an AngularJS tutorial, and we've found an elegant solution to this problem. This tutorial will guide you through the process of creating a frontend-only application. Firebase’s firebase.js and angularFire.js libraries offer an entirely new flavor of application: an app built with no backend server or code. The only parts of this application are the AngularJS app, the Firebase data store, and the minimal backend server to deliver the assets to the browser. Our intention with this tutorial is to provide the AngularJS community with instructions on how to design and build an ultra-modern application. 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. The tutorial is a living thing, a work in progress. app/js/config.js
AngularJS Abstractions: Organizing Modules Now that we know a bit about how modules work at an API level, we can look at questions that will be asked more than once in the lifetime of a project, like when to create a module, how many modules to create, and how to organize source code files for a module. One thing to recognize early on is how much flexibility is available. Although the term "module" sounds like the JavaScript module design pattern (a single function inside a single file), there is nothing about an AngularJS module that requires all the code for a module to exist in a single file, or in a single function. Your code can use multiple JavaScript modules to add features to a single AngularJS module. The code below is creating an alerter service to add to the patientApp.Services module, and could be one of many such pieces of code scattered across various files. Given this amount of flexibility, there are no real limitations on the number of modules and files you create. Reference Material
The Next Big Programming Language You’ve Never Heard Of | Enterprise Getty Andrei Alexandrescu didn’t stand much of a chance. And neither did Walter Bright. When the two men met for beers at a Seattle bar in 2005, each was in the midst of building a new programming language, trying to remake the way the world creates and runs its computer software. That’s something pretty close to a hopeless task, as Bright knew all too well. Alexandrescu, a graduate student at the time, could’ve said the same thing to Bright, an engineer who had left the venerable software maker Symantec a few years earlier. Andrei Alexandrescu.Photo: Ariel Zambelich/WIRED The result is a programming language that just might defy the odds. C++ is an extremely fast language—meaning software built with it runs at high speed—and it provides great control over your code. Among the giants of tech, this is an increasingly common goal. In the past, the programming world was split in two: the fast languages and the simpler modern languages. The Cape of a Superhero For Alexandrescu, D is unique.
AngularJS on Rails 4 - Part 1 - coderberry AngularJS seems to be the big craze as of late. Some may agree and some may not, but AngularJS is one of the next big contenders for being the number one choice of developers. At the time of writing this article, AngularJS is the 15th most watched project on GitHub . A few days back, I presented at our local ruby users group on writing an API-driven Rails app with AngularJS on the front end. Here I want to create a useful Rails application using AngularJS. The title of the article states that we will be using Rails 4 in our application. Creating the Rails Application I had a hard time deciding when I began this project on whether to use a full Rails application or a very lightweight ruby web stack like Sinatra . Before anything, we need to install the rails-api gem in order for us to create our app. $ gem install rails-api Once that is installed, lets create a new Rails application called Angular Casts $ rails-api new angular_casts $ mkdir -p app/assets/javascripts Create the Model $ rake test
Leveling Up in Angular - HTML5DevConf in Angular Alicia Liu @aliciatweet Sr Software Engineer, Lift Enjoyment of Angular AngularRULEZ I'm doingit wrong! services,modules promises,directives,... Module Organization Module By Feature Supports asynchronous loading of modules in the future From Angular Developer Guide Service vs Factory var Mario = function() { this.size = 'small'; }; Mario.prototype.eatMushroom = function() { this.size = 'large'; }; myModule.service('marioService', Mario); // calls new Mario() Provider Asynchronous Events // in some controller $scope. What happens if the data doesn't load? Promises $q var deferred = $q.defer(); svc.getMario = function() { return deferred.promise; }; ... deferred.resolve(data); ... deferred.reject(error); svc.getMario().then( doStuffWithMario, displayError ); Using Promises Chaining $q.all $q.when Interceptors Resolve myModule.controller('CharacterCtrl', function($scope, character) { $scope.character = character; }); Why Write Custom Directives? Restrict Scope
AngularJS Modules for Great Justice | Coding Smackdown TV First off I want to thank Joel Hooks of the DFW Area AngularJS Meetup Group for suggesting this topic and providing the title. “Modules provide an excellent mechanism for cleanly dividing up our code into functional areas. Angular allows us to use modules in many ways. Let’s take a look at modules and some of the approaches we can leverage to produce cleaner more manageable code.” – Joel Hooks So with that, let’s get started. As long as I have been developing with AngularJS there has always been the great best practices debate over how to structure your application. 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 Feature became popular in the Java development camp a few years back. Package-by-feature uses packages to reflect the feature set. A good example of Package by Feature, is the angular-sprout seed project. Package by Layer Tiny Projects <! Small Projects <!