ported to angular js