Sometimes you want Angular to watch an object only until a certain state is reached (e.g. an object appears in...
The Angular 1.2 way: # By default, angular returns undefined for invalid attributes which removes # the value from the form field...
Angular 1.3 offers $setDirty for your ngModelController. If you are stuck on Angular 1.2, do this: model.$setViewValue(model.$viewValue...
A lot of the advice involves less separations of concerns in your code ("don't use $watch", "don't use...
When using _.extend/_.assign or _.merge, you will modify the destination object. object1 = { foo: 23, bar: 42 } object2 = { bar: 99 }
The benefit of the Rails asset pipeline is that it compiles your stylesheets and javascripts to a single file, respectively...
In the Controller: // Instead of doing this: app.controller('TodoCtrl', function ($scope) { $scope.input = 'ex. buy milk'; }); // Do this: app.controller('TodoCtrl', function...
The Rails asset pipeline improves delivery of application assets (javascripts, stylesheets, images, fonts). Here are some basic facts about its...
When you run code inside a $watch expression that forces a repaint (e.g. by computing an element's width, or...
Clamps (ie. cuts off) an HTML element's content by adding ellipsis to it if the content inside is too...
The Angular ngSrc directive serves to properly set an image src via Angular. As anything in Angular, it updates the...
...which implements the technique in this card with tests and all caveats fixed. Related topic: JavaScript: Working with Query Parameters Javascript: Read params from url...
BubbleTree is a library for interactive visualization of hierarchical data. Originally developed mainly for spending data, the library is now...
Raphaël is a small JavaScript library that should simplify your work with vector graphics on the web. If you want...
An amped-up alternative to Turbolinks that differs in points like this: It's opt-in instead of opt-out...
Have you ever opened a file with vim, edited it and when you wanted to save your changes it told...
Restangular can make use of $http's built-in response cache. # Cache response for single request Restangular.one('accounts', 123).withHttpConfig...
Javascript library for drag'n'drop that seems to have more options than native HTML5 drag'n'drop.
To bind an HTML value to ng-bind-html, you need to mark it as "trusted" first. Among other ways...
When you need to check a value for presence, don't rely on JavaScript since it considers 0 or "0...
In a JavaScript console, type this: > 9112347935156469760 9112347935156470000 Ooops. And that's not a float! This occurs because JavaScript uses...
Browsers make this very hard. Even when you explicitely set the selection inside the textarea (e. g. using jquery-fieldselection...
The asset pipeline changes the paths of CSS files during precompilation. This opens a world of pain when CSS files...
JavaScript's NaN ("Not a Number") is hard to compare against. It never equals anything, not even itself: