Related cards:
AngularJS 1: How to keep "ng-hidden" elements from flickering on page load
When you have an element you want to hide, you can add a ng-show='isOpen'
attribute to that element. When you set isOpen
to false
on the scope, the element will be hidden.
However, when you load the page, the element is usually rendered by ...
How to create giant memory leaks in AngularJS (and other client-side JavaScript)
This guide shows how to create an AngularJS application that consumes more and more memory until, eventually, the browser process crashes on your users.
Although this guide has been written for Angular 1 originally, most of the advice is relevant...
AngularJS: Binding to Perl-style getter/setters functions
Angular 1.3+ has an alternative getter/setter pattern: You can bind ng-model
to an accessor function. This is a function that ...
Lightning Talk: Coverage based Test Case Prioritization in Ruby on Rails
For my computer science bachelor's thesis I programmed and evaluated a CLI Test Case Prioritization (TCP) tool for makandra. It has been written as a Ruby Gem and was tested and evaluated against one Ruby on Rails project....
Rails: Example on how to extract domain independent code from the `app/models` folder to the `lib/` folder
This cards describes an example with a Github Client on how to keep your Rails application more maintainable by extracting domain independent code from the app/models
folder to the lib/
folder. The approach is applicable to arbitrary scenarios...
"controller as" syntax for AngularJS 1.2+
In the Controller:
// Instead of doing this:
app.controller('TodoCtrl', function ($scope) {
$scope.input = 'ex. buy milk';
});
// Do this:
app.controller('TodoCtrl', function () {
this.input = 'ex. buy milk';
});
In the HTML:
<...
AngularJS directive to format a text with paragraphs and new lines
If you are using Angular and want something like Rails' simple_format
which HTML-formats a plain-text input into paragraphs and line breaks, this directive is for you.
Any ...
Best practices: Large data migrations from legacy systems
Migrating data from a legacy into a new system can be a surprisingly large undertaking. We have done this a few times. While there are significant differences from project to project, we do have a list of general suggestions.
Before you start, ta...
AngularJS: Access the scope for a rendered DOM element
This trick might be useful to implement more complicated directives in AngularJS. I needed it to do drag'n'drop in a hierarchical tree.
Let's say you have this $scope
in your Angular controller:
$scope.tasks = [
{ 'text': 'Task 1' },
{...
Angular-xeditable :: Edit in place for AngularJS
Angular-xeditable is a bundle of AngularJS directives that allows you to create editable elements.
Such technique is also known as click-to-edit or edit-in-place.
It is based on ideas of x-editable but was written from scratch to use power...