tunely ported to angular, remained to remove some jquery parts