unifying ionic and webapp controllers