Inspecting Angular 1.x UI Router
If your Angular app has some decent complexity, it will not be easy to use UI Router straight away. Here are some hints on how to get around.
Accessing the UI Router $state service from the browser console
$state = angular.element(document.body).injector().get('$state')
: Retrieves the Angular injector and asks it for the $state
service.
Inspecting the current state
$state.current
Inspecting params of the current state
$state.params
Related cards:
How to view Image Metadata on the Linux Command Line with ImageMagick
ImageMagick has a command line tool called identify
which can read image metadata:
>identify -verbose DSC00136.JPG
Image: DSC00136.JPG
Format: JPEG (Joint Photographic Experts Group JFIF format)
Class: DirectClass
Geometry: 5472x3648+...
How to create memory leaks in jQuery
jQuery doesn't store information about event listeners and data
values with the element itself. This information is instead stored in a global, internal jQuery cache object. Every time you add an event listener or data value to a jQuery object, ...
Understanding grid sizes of (SVG) icons
A primer on vector graphics
For rastered image formats like JPG or PNG, each pixel is basically drawn on a fixed size canvas. To display such an image in a different size (say: 1.5 times larger than original), the renderer (your Browser / GPU...
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...
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...
Video transcoding: Web and native playback overview (April 2020)
Intro
Embedding videos on a website is very easy, add a <video>
tag to your source code and it just works. Most of the time.
The thing is: Both the **operating system and Browser of your client must support the container ...
Fixing flaky E2E tests
An end-to-end test (E2E test) is a script that remote-controls a web browser with tools like Selenium WebDriver. This card shows basic techniques for fixing a flaky E2E test suite that sometimes passes and sometimes fails.
Although many examples ...
Angular + ui-router: Make links work in a new tab
If your angular app is not served on /
, but on a different url (say /admin
), links generated with ui-router will not work when you open them in a new tab.
Fix this by adding this tag in your <head>
:
<base href='/admin#/'>
Helper m...
Upgrade from Ruby 1.8.7 to Ruby 1.9.2 on Ubuntu
Note that you cannot currently use Ruby 1.9.2 with Rails 2 applications that use RSpec, so don't upgrade if that is your setup. The rspec-rails gem has a fatal bug that was only fixed for rspe...
state_machine: Test whether an object can take a transition
When using state_machine you sometimes need to know whether an object may execute a certain transition. Let's take an arbitrary object such as a blog article as an example that has those states:
...